Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-11-2009, 12:40 PM   PM User | #1
jarv
Banned

 
Join Date: Mar 2007
Posts: 1,523
Thanks: 116
Thanked 0 Times in 0 Posts
jarv can only hope to improve
Question align text next to image?!

am i losing it?!

on my site: http://www.wildfire-digital.com/test/lha/video.asp

at the top, I would like to align the text Welcome to LHA next to the logo, can someone please help?

thanks

css:

Code:
.toplogo{width:1020px; height:100px; margin: 0px auto; display:block; text-align:left; background-image:url(img/lha-top.gif); background-repeat:repeat-x;  }
.welcometext { font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#FFF; width:200px; height:100px; }
html:
Code:
<div class="toplogo"><img src="img/LHA-logo.gif" border="0" alt="LHA logo"/><div class="welcometext">Welcome to LHA</div>
jarv is offline   Reply With Quote
Old 03-11-2009, 01:03 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Code:
img.logo{
float:left;
}
.welcometext {/*styles.css (line 360)*/
color:#fff;
font-family:Arial,Helvetica,sans-serif;
font-size:14px;
line-height:100px;
width:200px;
}
Code:
<div class="toplogo">
<img border="0" alt="LHA logo" src="img/LHA-logo.gif" class="logo"/>
<h2 class="welcometext">Welcome to LHA</h2>
</div>
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 03-11-2009, 01:06 PM   PM User | #3
BoldUlysses
Regular Coder

 
BoldUlysses's Avatar
 
Join Date: Jan 2008
Location: Winston-Salem, NC
Posts: 938
Thanks: 10
Thanked 190 Times in 187 Posts
BoldUlysses is on a distinguished road
Try changing

Code:
<div class="welcometext">Welcome to LHA</div>
to

Code:
<span class="welcometext">Welcome to LHA</span>
Divs are block-level elements and will force a line break before and after unless you float them. Spans are inline elements and behave differently. Note that widths and heights don't apply to inline elements, but you can control them somewhat by using line-height and padding.

Edit: On second thought, go with abduraooft's method. It's more semantically appropriate to use the header tags.
__________________
matt | design | blog
BoldUlysses is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 +1. The time now is 01:13 AM.


Advertisement
Log in to turn off these ads.