Question:
XHTML/CSS issue :- Replacement code for tables?
raisin_smiles
2008-12-16 04:54:18 UTC
I currently have a heading with the following css attributes
(border: none;
background: #CC99FF;
vertical-align: center;
top: 80px;)

Directly underneath is a division called navigation with css style (float: left) where I print a set of buttons within a table using table settings (
I currently has these issues:-

A) The navigation buttons are NOT printing directly underneath the header. If i set a border on the heading division the buttons are printed directly below it, but I currently have set NO borders.

B) XHtml and table use is not recommended I believe, if I remove the table I was unable to get the navigation buttons printed alongside each other without whitespace appearing between each button.

Can anyone please assist in my layout, let me know if you need to see any more of my code.

Thanks
Three answers:
Chris C
2008-12-16 05:52:52 UTC
First off, get the "reset" CSS from Eric Meyer: http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/



That will start all borders, margins, padding at the same in every browser.

Here are your answers:



A,B) To get whitespace between them, ditch the tables and use code like this:





You'll need additional CSS for the "navigation", "nav", and "active" items above, like this:







C) To handle the images being space properly, remove the "" and "" tags from each of them, and add the attribute 'class="myimg" ' to each of the images, like this:







And of course the following CSS in the section of your code:

JD
2008-12-16 05:39:48 UTC
can u paste the source code here ??



hi buddy :)



well our frnd chris already defined and explained this clearly so hope it will solve ur query and in addition to tht i wanna to say something regarding ur query.



as ur have defined the buttons in and they are not the block elements and u also given the float left property; so just use
after or before ur top navigation ending div. they u will get ur navigation buttons after the heading division.





B) you can use tables in XHTML it's not tht u can't use tables in tht but as being an XHTML u have to close (else get errors on page rederning) each n every html tag even if it's a single tag like u have to close them using " /" eg.



in addition to that try not to use the .PNG images as they will give some issues in IE6 and below as they don't support them use jpg or gif instead.



rest if ur still facing any problems u can write to me at j_d132@yahoo.com :D



Cheers!!!
laci
2016-05-31 02:48:34 UTC
Confusing?


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...