开发者

How to set fieldset border from legend bottom?

开发者 https://www.devze.com 2023-01-14 21:31 出处:网络
I have fieldset and legend. fieldset border is coming in the middle of the legend like below But I want border like below

I have fieldset and legend. fieldset border is coming in the middle of the legend like below

How to set fieldset border from legend bottom?

But I want border like below

How to set fieldset border from legend bottom?

Border line should come below legend.

I am using below css.

.fiel开发者_StackOverflowdSet
{
    width: 97%; 
    margin-left: 10px;
    border-color: #003366;
}

.legendStyle
{
    border-style:none;
    background-color: #003366;
    font-family: Tahoma, Arial, Helvetica;
    font-weight: bold;
    font-size: 9.5pt;
    Color: White;
    width:30%;
    padding-left:10px;

}


try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title></title>
    <style type="text/css">
    fieldSet
    {
        width: 97%; 
        margin-left: 10px;
        border:0;
        margin:0;
    }

    legend
    {

        border-style:none;
        background-color: #003366;
        font-family: Tahoma, Arial, Helvetica;
        font-weight: bold;
        font-size: 9.5pt;
        Color: White;
        width:30%;
        padding-left:10px;

    }

    fieldset div { border:1px solid #003366; position:relative; top:-6px }

    </style>
</head>
<body>

    <fieldset>
        <legend>Employee Information</legend>
        <div>
            <label for="x">some label</label>
            <input type="text" name="x" />
        </div>
    </fieldset>

</body>
</html>
0

精彩评论

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