Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

133
Visualizações
HTML H1 - Header Styles Complications

This design layout is the objective

div {
background-color: #ccc;
width: 100%;
color: #ffffff;
}

div > div {
background-color: #000;
width: 80%;
margin: auto;
}
h1::before {
  content: '';
  display:block;
  height: 30px;  /*height of icon */
   width: 30px;  /*width of icon */
  border-radius: 15px;
  color: #fff;
   position: absolute;
   left: 5%;
  margin-top: 30px;
      /*background */
    background: #ffffff no-repeat 0px 0px;
  
}
<div><div><h1>Für Designer, Schriftsetzer, Layouter, Grafikenthusiasten und alle anderen</h1><div><div>

The example code above is using a inside another . The actual code uses a layout that is inside another container. So the dot and line elements in the screenshot are outside that container.

The dot is currently displayed with a pseudo-element. I can display the circle but I would like to create the line on the left of it as well. The left-end of the line needs to be stretched to the left edge of the browser.

Thanks

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

div {
background-color: #ccc;
width: 100%;
color: #ffffff;
}

div > div {
background-color: #000;
width: 80%;
margin: auto;
}
h1::before {
  content: '';
  display:block;
  height: 30px;  /*height of icon */
   width: 30px;  /*width of icon */
  border-radius: 15px;
  color: #fff;
   position: absolute;
   left: 5%;
  margin-top: 30px;
      /*background */
    background: #ffffff no-repeat 0px 0px;
  
}

h1::after {
    content: '';
    display: block;
    height: 6px;
    width: 41px;
    border-radius: 15px;
    color: red;
    position: absolute;
    left: 0%;
    margin-top: 30px;
    background: #ffffff no-repeat 0px 0px;
    top: 35px;
}
<div><div><h1>Für Designer, Schriftsetzer, Layouter, Grafikenthusiasten und alle anderen</h1><div><div>

about 4 years ago · Juan Pablo Isaza Relatório

0

You can solve this by adding an :after pseudo-element to your H1 element and apply some styles to it.

I've created a code example that might help you out. It also centers the dot and line vertically if the header is being displayed with multiple lines:

div {
    background-color: #ccc;
    width: 100%;
    color: #ffffff;
  }
  
  div>div {
    background-color: #000;
    width: 80%;
    margin: auto;
  }
  
  h1 {
    position: relative;
  }
  
  h1::before {
    content: '';
    display: block;
    height: 30px;
    width: 30px;
    border-radius: 15px;
    color: #fff;
    position: absolute;
    left: -5%;
    top: 50%;
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    background: #ffffff no-repeat 0px 0px;
  
  }
  
  h1::after {
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    left: -105%;
    border: 1px solid blue;
    width: 100%;
  }
    <div><div><h1>Für Designer, Schriftsetzer, Layouter, Grafikenthusiasten und alle anderen</h1><div><div>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda