开发者

What's the easiest way to remove <fieldset> border lines?

What's the easiest way to remove the border lines of a <fieldset>?

I mean a cross-brows开发者_开发知识库er solution... is that possible ?


fieldset {
    border: 0;
}


fieldset {
   border:0 none;
}


(In regards to Marko's comment)

As far as positioning/styling the <legend>, I hide the <legend> (still put one in there just to be semantic), and position/style an <h2> instead. I find this setup gives me nice styling options for my fieldsets.

  • JSFiddle Link: http://jsfiddle.net/axYQs/

fieldset {
    border: 2px solid gray;
    padding: 1em;
    float: left;
    font-family: Arial;
}
legend {
    display: none;
}
h2 {
    border-bottom: 2px solid gray;
    margin: 1em 0;
}
p {
    margin: 1em 0;
}
<fieldset>
    <legend>Enter Name</legend>
    <h2>Enter Name</h2>
    <p>
        <label for="name">Name:</label>
        <br />
        <input type="text" name="firstname" id="name"/>
    </p>
    <p>
        <input type="submit" value="Submit"/>
    </p>
</fieldset>


Here is a quick easy effective way to style it..

assign a class or id to the fieldset element then style it in css.

<fieldset class="fieldset"> 

or

<fieldset id="fieldset">
css.fieldset {
border: none;
}   

or

fieldset {
border: none;
}   
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜