New to CSS Layout

This is a discussion on "New to CSS Layout" within the Web Page Design section. This forum, and the thread "New to CSS Layout are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 2nd, 2007, 17:34
New Member
Join Date: Oct 2007
Location: UK
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
New to CSS Layout

Hi all

I'm new to both this site and CSS layouts. I have basic knowledge of CSS having used it for text styles within tables etc for years. I am trying to broaden my knowledge.

I would like to know whether this style of layout is possible to be created purely with <div> etc. I am aware that the content from the DB will need to be in tables.

http://www.notionsforpotions.co.uk/t...eideaframe.jpg

I have created a nav bar using unordered list and have styled it. I am however having problems in positioning it. Wherever I place it, it always displays about 10px south of where it should be. Is this a common problem with this style of navagation, and if so, is there an easy fix.

Here's the code I have used; (taken and edited form listmatic)

HTML: Select all
#navcontainer ul {
        position:absolute;
        display: block;
        list-style: none;
        font-family: times, serif;
        font-size: small;

    }

#navcontainer li {
        border: 1px solid #fff;
        background-color: #cccc9e;
        color: #ffffff;
        font-weight: bold;
        font-style: italic;
        display: block;
        float: left;
    }

#navcontainer a:link,
#navcontainer a:visited {
        background-color: #cccc9e;
        color: #666632;
        text-decoration: none;
        padding-left: 1em;
        padding-right: 1em;
    }

#navcontainer a:hover {
        background-color: #666632;
        color: #fff;
    }

#navcontainerclear {
        display: none;
    }

html>body #navcontainerclear {
        display: block;
        clear: both;
    }

#navcontainer li#active a {
        background-color: #666632;
        color: #fff;
    }
I am currently reading Beginning CSS Web Development by Simon Collinson
Its an informative book, but if anyone is aware of a good book to help self teach me this skill, I would be very appreciative.

Best regards

Tapster
Reply With Quote

  #2 (permalink)  
Old Oct 2nd, 2007, 17:37
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: New to CSS Layout

try putting
* {margin: 0px; padding: 0px}
at the top of your stylesheet
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #3 (permalink)  
Old Oct 2nd, 2007, 17:37
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,650
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: New to CSS Layout

Can we see the HTML to go with the CSS, please?
Reply With Quote
  #4 (permalink)  
Old Oct 2nd, 2007, 17:40
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: New to CSS Layout

Quote:
Originally Posted by Marc View Post
Can we see the HTML to go with the CSS, please?
better yet host (freewebs if you don't have a host)
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #5 (permalink)  
Old Oct 2nd, 2007, 17:42
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: New to CSS Layout

Why are you using position: absolute on your navbar <ul>?

Last edited by MikeHopley; Oct 2nd, 2007 at 17:46.
Reply With Quote
  #6 (permalink)  
Old Oct 2nd, 2007, 17:50
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: New to CSS Layout

Quote:
Originally Posted by alexgeek View Post
try putting
* {margin: 0px; padding: 0px}
at the top of your stylesheet
Please stop suggesting this method as a cure for everything!


tapster: It would help if you posted a link to your site like others suggested so we can see the whole thing
Reply With Quote
  #7 (permalink)  
Old Oct 2nd, 2007, 17:59
New Member
Join Date: Oct 2007
Location: UK
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: New to CSS Layout

Flipping heck this is a fast site. !!!

http://www.notionsforpotions.co.uk/testers

There is a link to what I have done so far. Please don't laugh at my feable attempt.!!!
Reply With Quote
  #8 (permalink)  
Old Oct 2nd, 2007, 18:00
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: New to CSS Layout

Quote:
Originally Posted by tapster View Post
Flipping heck this is a fast site. !!!

http://www.notionsforpotions.co.uk/testers

There is a link to what I have done so far. Please don't laugh at my feable attempt.!!!
why would we laugh at that? It's great attempt!
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #9 (permalink)  
Old Oct 2nd, 2007, 18:02
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: New to CSS Layout

First of all ... this is a 2-column site so ... what I would do is create 2 ID: col1 and col2

#col1 would have those 2 boxes

#col2 would house your navigation and your content

just float col1 to left and col2 to right
Reply With Quote
  #10 (permalink)  
Old Oct 2nd, 2007, 18:03
New Member
Join Date: Oct 2007
Location: UK
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: New to CSS Layout

Thanks

As you can see, I have having a little trouble positioning the nav bar.
Reply With Quote
  #11 (permalink)  
Old Oct 2nd, 2007, 18:04
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: New to CSS Layout

Oh and you're also missing a </ul> in there
Reply With Quote
  #12 (permalink)  
Old Oct 2nd, 2007, 18:27
New Member
Join Date: Oct 2007
Location: UK
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: New to CSS Layout

Thanks for that. I will see how I get on with a 2 column layout.

It certainly makes sense to do it like that.

Is that the only way to be able to layout with CSS? Does it have to be something that will always fit in columns?

Its probably obvious when I switch my brain on and think about it but its getting late now
:bounce8:
Thanks again for all your replies.
Reply With Quote
  #13 (permalink)  
Old Oct 2nd, 2007, 18:30
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: New to CSS Layout

No ... a layout doesn't "have" to be in columns.

Just look at the styles applied at the CSS Zen Garden

There's all types of layouts. Just thought that telling you to use 2 columns might be more obvious and simpler
Reply With Quote
  #14 (permalink)  
Old Oct 2nd, 2007, 18:59
New Member
Join Date: Oct 2007
Location: UK
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: New to CSS Layout

Thanks. Yeah I have seen that site before. I will take another look and more notice of how things are laid out in future
Reply With Quote
  #15 (permalink)  
Old Oct 12th, 2007, 16:02
New Member
Join Date: Jul 2004
Location: Olympic Penninsula WA
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to capture Send a message via Yahoo to capture
Re: New to CSS Layout

You can view my 2-column layout tutorial here:

http://lynx.tygerz.com/layouts_03.php

Also are tutorials for one-column with horizontal menu and a
three column layout (kind of a hack, but it works and keeps the
colors in the left and right columns all the way to the bottom even
if the center column is longer).

I have made webpages for clients using this 2 column layout and
they are very happy with the results:
One client's site:
http://richardhackworth.com

I hope this helps with your 2 column layout.

All the Best,
CP
Reply With Quote
  #16 (permalink)  
Old Oct 15th, 2007, 10:18
New Member
Join Date: Oct 2007
Location: UK
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: New to CSS Layout

Thanks very much for that. Since I initially posted this, I have had no time to play. But I intend to find some time this week.
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS layout casho Web Page Design 4 Feb 10th, 2008 13:59
Layout using CSS Madball Web Page Design 5 Nov 7th, 2007 09:41
please help on css layout geyids Web Page Design 12 Aug 18th, 2007 17:06
Fluid layout - IE6 clichés the layout when resizing cyberseed Web Page Design 7 Jun 16th, 2007 05:14
What makes a layout a good layout? Miles Lombardi Graphics and 3D 4 Jul 26th, 2005 03:22


All times are GMT. The time now is 02:50.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43