Home html How to make an indent on the left CSS?

How to make an indent on the left CSS?

Author

Date

Category

I need to make such a Header

Rear background – picture. Text – Link to Main Page Site.

I got this Header

How to add an outset to the left for text links?

My code HTML

& lt; body & gt;
& lt; div id = "Main" & gt;
  & lt; div id = "Header" & gt;
    & lt; h1 & gt; & lt; a href = "index.html" & gt; & lt; p & gt; my first simple site & lt; / p & gt; & lt; / a & gt; & lt; / h1 & gt;
  & lt; / div & gt;

CSS:

# Header {
Height: 90px;
Background: # 2A79BC URL ("images / header.png") no-repeat;
}
#Header H1 {
Font-Size: 28px;
Letter-spacing: -1px;
Padding: 20px, 0, 0, 20px;
Color: # FF5500;
}
#Header H1 A {
Color: #FFF;
Text-Decoration: None;
font-weight: 100;
Letter-spacing: -2px;
margin-left: 100px;
}
#Header H1 A: Hover {
Color: # 111;
}
#Header H1 A P {
margin-left: 10px;
Padding-left: 100px;
}

By adding a paragraph to the link, it was possible to lower it below, but the retake of the left does not work.

Now my code looks like this

html:

& lt; div id = "header" & gt;
    & lt; h1 & gt; & lt; a href = "index.html" & gt; My first simple site & lt; / a & gt; & lt; / h1 & gt;
  & lt; / div & gt;

CSS:

# Header {
Height: 90px;
Background: # 2A79BC URL ("images / header.png") no-repeat;
}
#Header H1 {
Font-Size: 28px;
Letter-spacing: -1px;
Padding: 20px 0 0 20px;
Color: # FF5500;
}
 #Header H1 A {
 Color: #FFF;
 Text-Decoration: None;
 font-weight: 100;
 Letter-spacing: -2px;
 margin-left: 100px;
 }
 #Header H1 A: Hover {
 Color: # 111;
 }
a {
Text-Decoration: None;
Color: # 4682B4;
}
A: Hover {
Text-Decoration: Underline;
Color: # 2A52BE;
}

Here is a screen from the site.


Answer 1, Authority 100%

Remove the P tag from the link, and the indents are satisfied
Padding: 20px 0 0 20px; That is, remove the commas.

PS so that everything worked. Write so:

& lt; div id = "main" & gt;
 & lt; div id = "Header" & gt;
  & lt; h1 & gt; & lt; a href = "index.html" & gt;
   My first simple site
  & lt; / a & gt; & lt; / h1 & gt;
 & lt; / div & gt;
& lt; / div & gt;
#Header {
 Height: 90px;
 Background: # 2A79BC URL ("images / header.png") no-repeat;
}
#Header H1 {
 Font-Size: 28px;
 Letter-spacing: -1px;
 Padding: 20px 0 0 20px;
 Color: # FF5500;
}
#Header H1 A {
 Color: #FFF;
 Text-Decoration: None;
 font-weight: 100;
 Letter-spacing: -2px;
 // margin-left: 100px;
}
#Header H1 A: Hover {
 Color: # 111;
}

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions