question about floating

This is a discussion on question about floating within the CSS forums, part of the Development category; i have a simple question, for example i have a link at the left edge of a div and link ...


Reply
 
LinkBack Thread Tools Display Modes
Old 26th November 2009, 02:24 AM   #1
Member
 
Join Date: Sep 2009
Posts: 169
Thanks: 0
Thanked 0 Times in 0 Posts
sudhakararaog is on a distinguished road
Expertise: Total Beginner
Experience: Basic / None
Default question about floating

i have a simple question, for example i have a link at the left edge of a div and link at the right edge of a div, a typical example would be at the footer.

what i normally do is take 2 divs and float them and set text-align: right for the 2nd div

Code:
#left{
float: left;
width: 500px;
height: 10px;
}

#right{
float: left;
width: 400px;
height: 10px;
text-align: right;
}
now in the left and right div i add the links 1 in left and 1 in right, all this works fine

however because its a small thing i was wondering if there is a much more simple way to do this instead of taking 2 divs and floating them and for the next content clearing needs to be used.

1. i guess i can use 2 p tags however i have to set them to display: inline which might not be ideal i guess

2. take 2 a tags and give them separate class names and set one class to float: left and the other to float: right
is there a much better and efficient way to achieve this effect apart from the 2 methods i mentioned above and using 2 divs and floating them.

thanks.
sudhakararaog is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 28th November 2009, 05:44 PM   #2
admin
 
saltedm8's Avatar
 
Join Date: Dec 2008
Location: Kent Uk
Posts: 1,595
Blog Entries: 6
Thanks: 15
Thanked 49 Times in 49 Posts
saltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond reputesaltedm8 has a reputation beyond repute
Expertise: (X)HTML / CSS
Experience: Professional
Default

that question is really up to you, but you are not restricted to the <p> tag, you could use other tags too, or you could be specific and use #myfooter p: to be specific with what you want done
__________________
web design kent
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Reply

Tags
floating, question

Thread Tools
Display Modes