Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding color to br

Tags:

html

css

I want to give <br /> some color. but it is not getting applied

Here is the HTML

<br style="color:#EAEFF5" />

here is the screenshot. I want the white space to be colored

enter image description here

UPDATE

<div style="background-color:#EAEFF5; width:100%;" style="border: 1px solid black; border-collapse:collapse;" cellpadding="5px" cellspacing="2px">
<table  width="60%" cellpadding="5px" style="border: 1px solid black; border-collapse:collapse;"  cellspacing="1px" align="center">
    <tr>
        <th class="label" style="font-size: 120%; font-family: Courier New; text-align:center">
            Date
        </th>
        <th class="label" style="width: 7%; font-size: 120%; font-family: Courier New;text-align:center">
            Flat Status
        </th>
        <th class="label" style="width: 7%; font-size: 120%; font-family: Courier New;text-align:center">
            Comments
        </th>
    </tr>
    <tr>
        <td class="label" style="width: 7%; font-size: 120%; font-family: Courier New;text-align:center;">
            <input type="text" runat="server" id="txtdate" style="width: 75px;"/>
        </td>
        <td class="label" style="width: 7%; font-size: 120%; font-family: Courier New;text-align:center;">
            <%--<input id="txtcomments" type="text" runat="server" style="width: 75px;" />--%>

             <select id="ddlflatstatus" style="width: auto" name="flatstatus" runat="server">
                <option value="0">--- Select ---</option>
            </select>

        </td>
        <td class="label" style="width: 7%; font-size: 120%; font-family: Courier New;text-align:center;">
            <%--<input id="txtstatusdet" type="text" runat="server" style="width: 75px;" />--%>

             <asp:TextBox ID="txtcomments" runat="server" Width="150" TextMode="MultiLine"></asp:TextBox>

        </td>

    </tr>
</table></div>

<br style="background-color:#EAEFF5" />
like image 816
Nad Avatar asked Dec 05 '25 23:12

Nad


1 Answers

In HTML, you should never add styles to a whitespace character, which is what <br> effectively is.

Rather use a separator:

<div style="height: 10px; background-color: #EAEFF5"></div>
like image 134
Mike Rockétt Avatar answered Dec 07 '25 15:12

Mike Rockétt