June 18th, 2013, 08:22 AM
-
:last-child hassle?
ok i must be doing something wrong but this isnt working in firefox (havent tested any other browser).
Code:
fieldset {
margin-bottom: 5em;
border: 1px solid black;
padding: 1em;
width: auto;
}
fieldset:last-child {
margin: 0em !important;
}
[html]
<form action="process.php" enctype="multipart/form-data" method="post">
<fieldset>
<legend>General</legend>
..... elements
</fieldset>
<fieldset>
<legend>General</legend>
..... elements
</fieldset>
<fieldset>
<legend>General</legend>
..... elements
</fieldset>
[/html]
June 18th, 2013, 08:35 AM
-
Hi,
well, is that fieldset actually the last child of the form element? If there's a submit button or something else below, the selector won't find anything.
Maybe you mean :last-of-type?
June 18th, 2013, 08:45 AM
-
aah... i thought fieldset:last-child would mean "last child of field set"
there is indeed a submit button...