Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Special Interests > Visual Media > Web Design and Development

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 9, 2012, 04:36 PM   #1
thinkpatience
macrumors member
 
Join Date: Jun 2009
This is frustrating me... How do I Center text between two images?

Hi all, this is frustrating me... so essentially I have a website that looks like this:


----- Subtitle Text -----

"" is my logo
"-----" Are the two images (which are lines).
Subtitle text is obviously text.

Why is this so difficult?
Here's the HTML

Code:
 <div>
     <a href="#">
     <img class="logo" src="#" alt="..."/></a>
 </div>
 <div class="subtitle">
     <img src="#" width="60" height="1" alt="..."/>
     <h1>subtitle text</h1>
     <img src="#" width="60" height="1" alt="..."/>
 </div>
Any help would be greatly appreciated
thinkpatience is offline   0 Reply With Quote
Old Oct 9, 2012, 04:51 PM   #2
angelwatt
Moderator emeritus
 
angelwatt's Avatar
 
Join Date: Aug 2005
Location: USA
The h1 tag is a block element so it's going to add a newline before and after itself, which causes it to not be inline with the surrounding images.

You didn't supply any CSS you're trying. For the h1 you can do,

Code:
.subtitle h1 {
 display: inline;
}
This might be enough depending on your existing CSS. The divs will need a text-align:center; on them.
angelwatt is offline   0 Reply With Quote
Old Oct 9, 2012, 05:08 PM   #3
thinkpatience
Thread Starter
macrumors member
 
Join Date: Jun 2009
Ahh, I forgot h1 was a block element, duh ::facepalm:: I'll give it a shot and update, thanks!
thinkpatience is offline   0 Reply With Quote

Reply
MacRumors Forums > Special Interests > Visual Media > Web Design and Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:44 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC