943,917 Members | Top Members by Rank

Ad:
May 17th, 2008
0

Help with remaking existing site into CSS-layout struggle

Expand Post »
I have just started learning CSS for layout ( been taught to use tables, and did...:-S). Now I am really struggling to apply the theory on a practical project.

I need to remake my wesite into CSS, and am really struggling with how to go around layout!
The site is here:
http://www.worldbellydanceday.com/

Can please anyone make any suggestions how to slice it up and position the elements with CSS?

Do I position the 2 navigation menus as absolute? (it is not going to be liquid).

Help will be greatly appreciated!

reen.blom
Reputation Points: 18
Solved Threads: 1
Junior Poster in Training
reen.blom is offline Offline
79 posts
since Jul 2007
May 18th, 2008
0

Re: Help with remaking existing site into CSS-layout struggle

Hi,

I'd have the following layout:
+ Wrapper
A div to centre the website on the page.
Properties: height: 100%; width: 950px; margin: 0px auto 0px auto; padding: 0px; border: none; text-align: center;

+ Header
A div for the header banner
Properties: float: left; height: 60px; width: 950px; margin: 0px; padding: 0px; border: none;

+ Navigation (horizontal)
A div for the horizontal navigation bar
Properties: float: left; height: 40px; width: 950px; margin: 0px; padding: 0px; border: none;

+ Content
A div to contain ALL the content below
Properties: float: left; width: 950px; margin: 0px; padding: 0px; border: none;

+ Left pane
A div for the left navigation bar
Properties: float: left; width: 200px; margin: 0px; padding: 0px; border: none;

+ Centre pane
A div for the central content
Properties: float: left; width: 550px; margin: 0px; padding: 0px; border: none;

+ Right pane
A div for the right content
Properties: float: left; width: 200px; margin: 0px; padding: 0px; border: none;

+ Footer
A div for the footer content
Properties: float: left; height: 40px; width: 950px; margin: 10px 0px 0px 0px; padding: 0px; border: none;


This would give you seperate divs for each of the sections. You can then add elements to them, and with the float left property, their size will increase to accommodate whatever you add (in terms of height where the property isn't set).

With the images like the dancer (top left) and globe, you could either create separate divs and position them absolutely, and use z-index to put them on top, or perhaps cut the image into sections.

Hope this helps. It will definitely need tweaking.

R.
Reputation Points: 101
Solved Threads: 74
Posting Pro in Training
blocblue is offline Offline
430 posts
since Jan 2008
May 20th, 2008
1

Re: Help with remaking existing site into CSS-layout struggle

A few points:

- 0px is an invalid style. It causes browser errors. Use 0 for values that are zero.

- Convert all size and alignment tag attributes to styles.

- Use classes, so each set of styles can be used on all tags needing it.

- Use relative sizes, as percentages of the width of the containing element.

- Don't place nonzero surrounding styles (margin. border, padding) and size styles (width, height) in the same tag or style. Putting them together causes browser incompatibilities, because IE nests them in the wrong order.

- Convert one property type at a time. Then test the changes.

- Use tables if you need a structure to hang together when the window size changes. Use divs if you want to allow the content to slide around for maximum visibility without horizontal scrolling.

- Don't use absolute positioning or styles, except for image sizes.

- Test the page with different browsers and screen resolutions. Also play with the browser window size (in restore down), to see what happens when the resolution or window size becomes small.

- Use the W3C validator page.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
May 21st, 2008
0

Re: Help with remaking existing site into CSS-layout struggle

Click to Expand / Collapse  Quote originally posted by MidiMagic ...

- 0px is an invalid style. It causes browser errors. Use 0 for values that are zero.


- Don't place nonzero surrounding styles (margin. border, padding) and size styles (width, height) in the same tag or style. Putting them together causes browser incompatibilities, because IE nests them in the wrong order.


- Use the W3C validator page.
MidiMagic, I think, well actually, I know each of the above comments are incorrect. I've used 0px for styles on all the websites I've built and likewise, I've used margin, padding and borders in a single stylesheet element for a lot of those sites.

All my websites validate to W3C HTML 4.01 strict and CSS standards with 0 errors or warnings. So, if 0px is an invalid style, it would have been picked up. Likewise, I am pleased to say that my websites using these stylesheets are pixel perfect between FFX2, FFX3, IE6, IE7, Netscape, Opera and Safari.

Just some food for thought.
Reputation Points: 101
Solved Threads: 74
Posting Pro in Training
blocblue is offline Offline
430 posts
since Jan 2008
May 26th, 2008
1

Re: Help with remaking existing site into CSS-layout struggle

Click to Expand / Collapse  Quote originally posted by robothy ...
MidiMagic, I think, well actually, I know each of the above comments are incorrect. I've used 0px for styles on all the websites I've built and likewise, I've used margin, padding and borders in a single stylesheet element for a lot of those sites.

All my websites validate to W3C HTML 4.01 strict and CSS standards with 0 errors or warnings. So, if 0px is an invalid style, it would have been picked up. Likewise, I am pleased to say that my websites using these stylesheets are pixel perfect between FFX2, FFX3, IE6, IE7, Netscape, Opera and Safari.

Just some food for thought.
0px, 0pt, and other zero values with dimensions kick Firefox into quirks mode, and often prevents the style containing it from operating. It shows up as an error in the Firefox error console. It works, but in quirks mode.

But note that I use XHTML 1.0 Strict. This might be a deprecation in XHTML, but it is not caught by the W3C validator.

I use 4 tests on each page I produce or refurbish:

- Spellcheck

- W3C validation

- Browser rendering correctness and differences between browsers

- Firefox Error Console

---

You misread the part about the margins, borders, and padding. What does not work right is putting size styles (width, height) in the SAME tag that has nonzero surrounding styles (margin, border, padding). Nest two tags if you need both kinds of styles.

This second item is NOT a matter of validation, and it causes no browser errors. It causes those maddening rendering differences between IE and FF. IE wrongly puts the surrounding styles INSIDE the size measurements, unlike the other browsers that obey the standard. Nesting tags lets you force the order you want.
Last edited by MidiMagic; May 26th, 2008 at 1:14 am. Reason: update
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
May 26th, 2008
1

Re: Help with remaking existing site into CSS-layout struggle

MidiMagic, thanks for the reply. I'll take on board what you have said in your post.
R.
Reputation Points: 101
Solved Threads: 74
Posting Pro in Training
blocblue is offline Offline
430 posts
since Jan 2008
Jun 3rd, 2008
0

Re: Help with remaking existing site into CSS-layout struggle

Hi Robothy! Thabk you for your detailed expanation! Finally I recovered from being ill and managed to put it together! Before I read your suggestions I would try many ways and gets stuck each time, and now, here it is: :-)

http://www.worldbellydanceday.com/index2.html

I am still to tackle the drop down menus, although Im a bit confuse about the use of javaScript as some people have it disabled!

BIG HUG,
reen.blom
Reputation Points: 18
Solved Threads: 1
Junior Poster in Training
reen.blom is offline Offline
79 posts
since Jul 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Site Layout and Usability Forum Timeline: starting the first page
Next Thread in Site Layout and Usability Forum Timeline: form page to send an email





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC