Home > OS >  CSS Only works locally in style attribute and not in an external stylesheet
CSS Only works locally in style attribute and not in an external stylesheet

Time:10-10

My css only works if I use the style attribute and it doesn't work with an external stylesheet

.dateInput {
  text-align: center;
};
<div class="dateInput">
  <label for="aplan-date">Date Of A-Plan:</label>
  <input type="date" id="aplan-date" name="aplan-date">
</div>

Chrome also shows the div as having no style enter image description here

CodePudding user response:

Make sure that you included the stylesheet in your html file

CodePudding user response:

You have an extra semicolon.

.dateInput {
  text-align: center;
}
<div class="dateInput">
    <label for="aplan-date">Date Of A-Plan:</label>
    <input type="date" id="aplan-date" name="aplan-date">
</div>

  • Related