DIV color problem

Peter Volz 1,295 Reputation points
2023-05-24T17:05:59.2866667+00:00

Hello

I have this html style and body code:

.btn{
padding: 10px 20px;
-webkit-border-radius:3px;
border-radius:3px;
width:180px;
margin: 5px auto;
}

<div class="btn" style="background-color:#917AD1;color:#6E852E">Birthday</div>
<div class="btn" style="background-color:#7399E0;color:#8C661F">Blue category</div>

back color and font color must be set for each div separately, but font color won't work

Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. Lan Huang-MSFT 30,206 Reputation points Microsoft External Staff
    2023-05-25T02:16:56.1633333+00:00

    Hi @Peter Volz,

    I tested your code and it works fine.

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <style>
            .btn {
                padding: 10px 20px;
                -webkit-border-radius: 3px;
                border-radius: 3px;
                width: 180px;
                margin: 5px auto;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <div class="btn" style="background-color:#917AD1;color:#6E852E">Birthday</div>
    <div class="btn" style="background-color:#7399E0;color:#8C661F">Blue category</div>
        </form>
    </body>
    </html>
    

    User's image

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.