Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 07-13-2009, 10:20 PM CSS aligning
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
Does anybody know of a good way of aligning right and left with CSS. I've found this with google http://www.communitymx.com/content/a....cfm?cid=529B0 , and this code can be invalid.

I know you could do it with floats, but I've always enjoyed the simplicity of

Code:
<div align="right"></div>
instead of

Code:
<div style="float:right">
Some Content or image
</div>
<div style="clear:right"></div>
Thanks
__________________
Alex
konetch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-14-2009, 10:51 AM Re: CSS aligning
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
What's wrong with floats ? Give the div a dimension, which you need if you're going to use floats anyway. Float 1 right, the other left. Put them both inside a "wrapper" div and give that wrapper a overflow: auto to clear the floats. That's really all there is to it.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-14-2009, 11:04 AM Re: CSS aligning
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
There's nothing wrong with floats, but it also depends on on what you're aligning. If it's an inline element, you can simply set the text-align property to left or right. This will work for images as well as text, or any inline element. Just remember, if you float stuff, elements around it will hug it if it isn't cleared.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-14-2009, 06:06 PM Re: CSS aligning
angele803's Avatar
Perfectly Imperfect

Posts: 1,774
Name: Stephanie
Location: Oklahoma
Trades: 2
Putting "overflow: auto" on the containing div (like ladynred said) eliminates the need for the <div style="clear:right"></div> (in most cases), so that simplifies it a bit.
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 07-15-2009, 01:02 PM Re: CSS aligning
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
Thanks. I know most of CSS, but I still forget some things once in a while. I had no idea you could use overflow: auto
__________________
Alex
konetch is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS aligning
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27681 seconds with 12 queries