Jump to content

Left and right aligned on same line


wolfkin

Recommended Posts

First off some of your stickies look fascinating. Like many I'm new to this. I've read about 3-4 books cover to cover on CSS/XHTML but this is the first time I've had something to actually use it on.

 

I'm managing a church website and I don't know what was going on before but the site appears to me to be a mess. For my first step I'm trying to basically rewrite the website. If I can get a few basic problems solve this should be very doable and the result will be something much easier to work with.

 

My first "How do I replicate this" question is how to do get text on the left and right side of the page.

 

Originally it was a table (everything is tables within tables) two columns one left aligns one right aligned so it looks like

 

www.site.com                 home | contact | info

 

do I have to use tables or is there a way to do this with CSS? I've been trying to mess with text-align and span/div but I can't get the two sections to seperate

Link to comment
Share on other sites

It would also work to put each section in its own div and float them left/right respectively.

 

For example:

 

HTML:

 

www.sitename.com

 

 

CSS:

 

#sitename {

width: _____px;

height: _____px;

float: left;

}

 

#nav {

width: _____px;

height: _____px;

float: right;

}

 

Note: I don't recommend using paragraphs for those items, though. Maybe the site name should be an h1 and the nav links should be an unordered list. What I wrote is just for an example...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...