Jump to content

how do i do this kind of box with text inside


Derivan

Recommended Posts

First step.  Let's agree on what we're looking at.

I see buttons, floating inside a div, with some padding and a brown background.  What do you see?

  • Like 1
Link to comment
Share on other sites

22 minutes ago, niche said:

Primeiro passo. Vamos concordar com o que estamos olhando.

Vejo botões flutuando dentro de uma div, com algum preenchimento e um fundo marrom. O que você vê?

It's not a button, it's more like a tag, what I'd like to do is this effect of a frame with the text inside (it doesn't have a brown color, it's actually a transparent one)

Link to comment
Share on other sites

All you need to do is add a border to an inline-block. Any element will do. If they link to anywhere, an <a> element will work.

.tag {
  display: inline-block;
  padding: 4px;
  color: #FFF;
  border: 1px solid #FFF;
  border-radius: 10px;
}

<a href="/" class="tag">Legendado</a>

For the filled block, you can give it a background-color and change the color to black.

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, Ingolme said:

Tudo que você precisa fazer é adicionar uma borda a um bloco embutido. Qualquer elemento serve. Se eles ligarem para qualquer lugar, um elemento <a> funcionará.



  

Para o bloco preenchido, você pode atribuir a ele uma cor de fundo e alterar a cor para preto.

thank you very much, now i managed to do

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...