Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

125
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda