Inspiring
July 5, 2022
Question
text alignment in UL list
- July 5, 2022
- 2 replies
- 383 views
I am having some problems with UL lists. I figured out how to code specific UL classes. The problem is, if the the line item is more than one line, the text floats to the left. Is there a way to align the text with the first line of the <li>?
Here is my class:
/*Mobile*/
@media (max-width: 380px){
ul.specifications-info {
list-style-type: none;
padding-top: 10px;
font-size: 1.5em;
padding-left: 10px;
margin-right: 10px;
font-family: Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", serif;
margin-left: 10px;
text-align: left;
}
}
/*Tablet*/
@media (min-width:381px) and (max-width:949px){
ul.specifications-info {
list-style-type: none;
padding-top: 10px;
font-size: 1.4em;
padding-left: 10px;
margin-left: 10px;
margin-right: 10px;
font-family: Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", serif;
text-align: left;
left: 0px;
list-style-position: inside;
}
}
/*Desktop*/
@media (min-width: 950px){
ul.specifications-info {
list-style-type: none;
padding-top: 10px;
font-size: 1.3em;
padding-left: 10px;
margin-left: 10px;
margin-right: 10px;
font-family: Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", serif;
text-align: left;
}
}
Attached is what I'm getting:
