Ignorant23
Ignorant23

Reputation: 101

css not applying on div

I'm trying to apply css to my div (questionFrame) I'm woundering why it is not working? See snippet. Could someone help?

#questionFrame {
  border: 5px;
  border-width: 5px;
  border-color: black;
}
<div id="questionFrame">
  <span style="color:#0091ea"><p id="date">Date Created</p></span>
  <div id="userQuestions"></div>
  <center>
    <div class="grid-container4">
      <a class="waves-effect waves-light btn #00e676 green accent-3" style="width:50%" onclick="grabData()">Proceed</a>
      <a class="waves-effect waves-light btn #ef5350 red lighten-1 " style="width:50%">Cancel</a>
    </div>
  </center>
</div>

Upvotes: 0

Views: 101

Answers (5)

user728627
user728627

Reputation: 406

Did you link it. Use

<link rel="stylesheet" href="YourStylesheet.css">

In the head of your html

Upvotes: -3

musefan
musefan

Reputation: 48415

The problem is that you have not specified the border style (for example "solid"). You can either do these separately:

#questionFrame {
  border: solid;
  border-width: 5px;
  border-color: black;
}

Or in a single statement:

#questionFrame {
  border: 5px solid black;
}

I would recommend that latter.

Upvotes: 3

K. P.
K. P.

Reputation: 561

You didn't set any style for your border like border:5px solid; or border-style:solid;

Here you can read more about the border styles: https://www.w3schools.com/css/css_border.asp

Upvotes: 2

לבני מלכה
לבני מלכה

Reputation: 16251

#questionFrame{
  border: 5px solid black;
}
   <div id="questionFrame" >
   <span style="color:#0091ea"><p id="date">Date Created</p></span>
   <div id="userQuestions"></div>
   <center><div class="grid-container4">
  <a class="waves-effect waves-light btn #00e676 green accent-3" style="width:50%" onclick="grabData()">Proceed</a>
  <a class="waves-effect waves-light btn #ef5350 red lighten-1 " style="width:50%">Cancel</a>
  </div></center>
   </div>


OR as your code:

border: solid;// not 5px
border-width: 5px;
border-color: black;

Upvotes: 2

charan kumar
charan kumar

Reputation: 2157

Try this

#questionFrame{
border:5px solid #000;
}

Or You can style like this

border: solid;
border-width: 5px;
border-color: black;

Upvotes: 1

Related Questions