I have a wordpress theme whose list is in the following format,
<ul class="ozy-custom-list wpb_content_element ">
<li>
<span class="oic oic-dot" style="color:#2f75aa"></span>
<span>Personalised Services</span>
</li>
<li>
<span class="oic oic-dot" style="color:#2f75aa">
</span><span>Complete support รขยย from Port to Destination</span>
</li>
</ul>
The first span is for the bullet and the second contains the text that goes after the bullet.
Now in the case of the second li element the text goes to the next line and below the bullet. I would like to add some padding to the second line so it doesn’t do below the bullet.
Here’s a picture to show whats happening,
How can I target the second line (i.e “destination”) ?
You can fix that by displaying the dot-span as an inline-block. Then you can give it a fix width and move it with a negative margin:
I made you this lookalike demo.
You will probably need to play a bit with the width and margin to adjust it to your website.
You want the “text-indent” css property:
Text-indent
indents the first line, so we push it backwards, but only after we pushed the ENTIRE text to the right.If you want to select 2nd line you can use following:
JSFiddle: https://jsfiddle.net/ws5rk0sx/
If you only need to align all lines equally use just:
Yes, you can use the following:
It would probably help however to give your ul an id, so that you could use:
Without messing up any other UL’s on the page. If it wasn’t the last li in the ul you can use nth type instead of last-child for the li tag ^^
I’ve created a JsFiddle here
I’ve applied the below css to the span:
If you prefer not to set a class on the element you could also use:
you could simply use a table without border ๐
first colm would contain the bullet and the second colm the info…