Home > Mobile >  Putting border around header
Putting border around header

Time:01-27

I'm trying to put a border around a header, nothing seems to be working... apologies, I'm pretty new to all of this, so is there another way?

header {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 10px;
  width: 852px;
  height: 179px;
  border: 10px #FFFFFF;
  border-radius: 6px;
  background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Vincent_van_Gogh_-_Self-portrait_with_grey_felt_hat_-_Google_Art_Project.jpg/250px-Vincent_van_Gogh_-_Self-portrait_with_grey_felt_hat_-_Google_Art_Project.jpg");
}
<header>
  <img src="https://www.brandbucket.com/sites/default/files/logo_uploads/284255/large_titletext.png" alt="ninenonzeg">
</header>

CodePudding user response:

Just use correct code format for border `border: 10px solid #000;`

Let me know if you want more info.

header {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 10px;
  width: 852px;
  height: 179px;
  border: 10px solid red;
  border-radius: 6px;
  background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Vincent_van_Gogh_-_Self-portrait_with_grey_felt_hat_-_Google_Art_Project.jpg/250px-Vincent_van_Gogh_-_Self-portrait_with_grey_felt_hat_-_Google_Art_Project.jpg");
background-position: center;
background-size: contain;
text-align: center;
}
  <header>
            <img src="https://www.brandbucket.com/sites/default/files/logo_uploads/284255/large_titletext.png" alt="ninenonzeg">
          </header>

CodePudding user response:

Change the border color then try to do that. I think that your background color and border color are similar. And also give the style of the border.

border: 10px solid #FFFFFF;

or

border-style:solid;

CodePudding user response:

Add solid attribute to border in css. do

  border: 10px solid #FFFFFF;

make sure you need a #FFF (white) border

  •  Tags:  
  • Related