Reputation: 321
This is a css text, I want to give all the tables in html pages a border with width 1px. But the html files are not reading this why? I can't see any borders in html files!!!!
<!-- <style type="text/css"> -->
body{background-color:pink;
}
input{background-color:green;
font-color=blue;
}
table.center {
margin-left:auto;
margin-right:auto;
border-width:10px solid;
}
.testext{color:gray};
<!-- </style> -->
Upvotes: 0
Views: 116
Reputation: 59799
Well you have two issues:
1) The property is not font-color
its color
and you have an =
instead of a :
between the property and its value which will cause that rule to be ignored
2) You should instead use the border
shorthand, as you're specifying two different properties using the border-width
property which obviously only accepts a single <length>
value, instead change to:
border: 10px solid black;
To gain a better understanding of CSS syntax, read the syntax module
Upvotes: 4
Reputation: 184
You need to separate the border styles. 'solid' is not a valid value of border-width. E.g. To produce a 10px width border:
table.center {
margin-left:auto;
margin-right:auto;
border-width:10px;
border-style: solid;
}
or combine like this:
table.center {
margin-left:auto;
margin-right:auto;
border: 10px solid;
}
Upvotes: 0
Reputation: 18549
Change
table.center {
margin-left:auto;
margin-right:auto;
border-width:10px solid;
}
to
table {
border: solid 10px #000;
}
table.center {
margin-left:auto;
margin-right:auto;
}
Assuming you'd done the border correctly, table.center
would only apply to tables with the class name 'center'
Upvotes: 1