user3078437 user3078437 - 4 months ago 14
HTML Question

how to handle braces mark?

Here is my problem:

in css

table{
position:absolute;
top:-100px;
left:90px;
margin:300px;
background-color:#000000;
a:link {text-decoration:none;}
a:visited {text-decoration:none;}
a:hover {background-color:Green;}
a:active {text-decoration:underline;}
}


{
mark which is next to
table
is closed by
}
mark that the end of
a:link {text-decoration:none;}
and opening brace mark
{
which is right next to
a:link
and closing brace mark
}
at the bottom are becoming useless.

How can I connect that first and last
{
}
marks with each other ? (not with that
a:link {text-decoration:none;}
this line's brace)

Answer

That's not correct CSS syntax. Correct would be:

table{
    position:absolute;
    top:-100px;
    left:90px;
    margin:300px;
    background-color:#000000;
}
table a:link {text-decoration:none;}
table a:visited {text-decoration:none;}
table a:hover {background-color:Green;}
table a:active {text-decoration:underline;}

If you want to nest CSS rules using the syntax in your question, you can use an alternate stylesheet language that compiles to CSS like LESS or SASS.

Comments