|
|||||||
| CSS Discussion and technical support relating to Cascading Style Sheets. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
problem with permanent centering or something
hello, my problem is that i used some css from somewhere to center my tables and keep them 600 pixels wide. but the css for the id causes everything to be centered. and i know how in css a rule in the beginning makes it go throughout. could someone help me change the code so that "you are here" and the nav below it are on the left but the table is still centered. a page that uses it is at http://www.shredmastersguitar.com/licks.html/ the you are here and nav should be on the left.
here is the css i use on each page <style type="text/css"> html, body { text-align:center; } #maintable { margin:auto; background-color:#C0C0C0; width:600px; } </style> then in the table tag i use id="maintable" thanks - jozef |
|
#2
|
|||
|
|||
|
This is called inheritance. The best solution [being aware of divitis] is to wrap the table in a DIV and then centre the table within that DIV. You can apply text-align:left; to the overall container but specify the table DIV to text-align:center;
HTML Code:
<div id="main">
<p>Hello</p>
<div id="wraptable">
...table code here...
</div>
</div>
Code:
#main{text-align:left;width:600px;}
#wraptable{text-align:center;width:100%;}
#wraptable table{width:400px;margin:auto;}
__________________
(((U+C+I) * (10-S)) / 20 * A * 1 / (1-sin (F / 10)) Wash your hands on the way out! | 0.9r = 1 |
|
#3
|
|||
|
|||
|
ok thanks a lot
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|