Problems with **UL inline**

Asked

Viewed 50 times

2

Good,

I have a problem making one ul inline thus because every time I try to hr and vertical-align always comes out of place.

This is the result you give me:

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

li {
    display: inline;
    padding-left: 20px;
}

a {
text-decoration:none;
color:#000000;
}

a:hover{
 color:#3ba09e;
}
   hr{
width:20px;
display:inline-block;
vertical-align:middle;
}
<ul>

<li><a href="#"><h4>Arquivo<h4/> <img src="http://culturalis.pt/wp-content/uploads/2015/06/bolinha.png"/><hr></hr></a></li>

<li><a href="#"><h4>Escritórios</h4> <img src="http://culturalis.pt/wp-content/uploads/2015/06/bolinha.png"/><hr></hr></a></li>

<li><a href="#"><h4>Escolas</h4> <img src="http://culturalis.pt/wp-content/uploads/2015/06/bolinha.png"/><hr></hr></a></li>

<li><a href="#"><h4>Outros</h4> <img src="http://culturalis.pt/wp-content/uploads/2015/06/bolinha.png"/><hr></hr></a></li>

</ul>

1 answer

4


You have misspelled the attributes of hr.

hr{
    with:20px;
    display:inline block;
    vertical-align:middle;
}

Is wrong the with and inline block, correct is:

hr{
    width:20px;
    display:inline-block;
    vertical-align:middle;
}

And change the h4 for span and assign the selector of your choice.

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

li {
    display: inline;
    padding-left: 20px;
}

a {
text-decoration:none;
color:#000000;
}

a:hover{
 color:#3ba09e;
}
   hr{
     width:20px;
     display:inline-block;
     vertical-align:middle;
     border: 1px solid red;
}

.textoMaior {
     font-size: 18px;
     font-weight: bold;
}
<ul>

<li><a href="#"><span class="textoMaior">Arquivo</span> <img src="http://culturalis.pt/wp-content/uploads/2015/06/bolinha.png"/><hr></hr></a></li>

<li><a href="#"><span class="textoMaior">Escritórios</span> <img src="http://culturalis.pt/wp-content/uploads/2015/06/bolinha.png"/><hr></hr></a></li>

<li><a href="#"><span class="textoMaior">Escolas</span> <img src="http://culturalis.pt/wp-content/uploads/2015/06/bolinha.png"/><hr></hr></a></li>

<li><a href="#"><span class="textoMaior">Outros</span> <img src="http://culturalis.pt/wp-content/uploads/2015/06/bolinha.png"/><hr></hr></a></li>

</ul>

  • Still I don’t know how you get all that spacing between the <H4> and the image.

  • 1

    @Brunogibellino I updated my response with your need.

  • thanks, just what I needed. But with background-color and color I can’t change hr’s color. I’m doing well?

  • 1

    @Brunogibellino Utilizei border-color instead of color

  • I really needed to use the H4 and when I changed the span for H4 that shaped everything. There is no way to use H4 with ul?

  • shaped as?

  • Instead of staying inline it all got in separate lines

  • 1

    Checks if there is no other element or selector giving conflict

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.