| | |
Layout Tables to CSS
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Mar 2004
Posts: 94
Reputation:
Solved Threads: 0
I have been working on my site for some time and its not yet been released. What I want to do is modify my layout so that it works with CSS insted of tables. All my efforts so far have gone in vain because the gaps between the <div> and <span> tags are just to wide and I have tryed everything I know to reduce them but they are still huge.
Does anyone know of any good tutorials or can give me some pointers as to where I might have gone wrong?
Does anyone know of any good tutorials or can give me some pointers as to where I might have gone wrong?
•
•
Join Date: Jul 2004
Posts: 5
Reputation:
Solved Threads: 1
Be sure to code for a browser, with CSS NS and IE dont' seem to agree on pixel locations. Like slade said, post your CSS along with your HTML page so he (and maybe I) may look it over. There are a buncha lil technical things that the W3C validators don't like, so don't mess with the pre-formated tags using style rules. If you want, I have a CSS tutorial at my site you could probably glance at, might help.
If you do visit my site, you'll notice that my content div is shifted, is there any way I can keep it aligned with the rest of the page at various resolutions? I'm using percent right now, but it's not working...
If you do visit my site, you'll notice that my content div is shifted, is there any way I can keep it aligned with the rest of the page at various resolutions? I'm using percent right now, but it's not working...
Div tags are generally used to encapsulate paragraphs, body content, and for text/image positioning and layout. Span tags are used to emphasize a word or two, such as
HTML and CSS Syntax (Toggle Plain Text)
<div>This is my paragraph. I would like to <span style="font-weight:bold">emphasize</span> this word.</div>
•
•
Join Date: Jul 2004
Posts: 5
Reputation:
Solved Threads: 1
•
•
•
•
Originally Posted by cscgal
Div tags are generally used to encapsulate paragraphs, body content, and for text/image positioning and layout. Span tags are used to emphasize a word or two, such as
HTML and CSS Syntax (Toggle Plain Text)
<div>This is my paragraph. I would like to <span style="font-weight:bold">emphasize</span> this word.</div>
You could use
HTML and CSS Syntax (Toggle Plain Text)
<em>blahblah</em>
When I started out with CSS I got a lot of help from source code at the csszengarden.com , also I think it's great more people are switching to tableless layouting 
Also the comment about coding for a browser is a good tip but you have to make sure you get it right for both IE and FF (the two most commonly used browsers), I think IE 8 is the most used version of IE now?
And yet another thing, if you're writing your css, you shouldn't use inline css (in my opinion). Your html should basicly only be
and as above the link to your css file is linking... to a separate css page. This way you'll never have to search around for any styles you made. Use clear id's and classes as not to get confused.
I hope I haven't overposted here...

Also the comment about coding for a browser is a good tip but you have to make sure you get it right for both IE and FF (the two most commonly used browsers), I think IE 8 is the most used version of IE now?
And yet another thing, if you're writing your css, you shouldn't use inline css (in my opinion). Your html should basicly only be
html Syntax (Toggle Plain Text)
<html> <head> <title>my page</title> <link to your css file!> <some meta tags> </head> <body> <some divs>with content</div> </body> </html>
and as above the link to your css file is linking... to a separate css page. This way you'll never have to search around for any styles you made. Use clear id's and classes as not to get confused.
I hope I haven't overposted here...
Last edited by peter_budo; Mar 10th, 2008 at 10:05 am. Reason: Keep It Organized - missing [code] tags
You just open 3 years old post, is there any need?
Last edited by peter_budo; Mar 10th, 2008 at 10:06 am.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- HTML Tables vs CSS & divs - examples/help (HTML and CSS)
- White Space Between Table Images (HTML and CSS)
Other Threads in the HTML and CSS Forum
- Previous Thread: Display a clock
- Next Thread: Cross-browser relatively absolute positioning
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7







