View Single Post
Old 09-12-2023, 12:10 PM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,361
Karma: 20212223
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by WV-Mike View Post
Other than a list, how would this be accomplished with CSS?
You could use css to make ANY tag look like any other tag. However, the point of using the correct tag is so that your document is using the correct semantic markup. This helps automated devices (and some weird humans who look at the coding ) parse the document properly.

For example, I used the following css on a style sheet to make a list of paragraphs look just like the unordered list. (see attachment)

Code:
/* list-style-type Formal syntax: disc | circle | square | decimal |
decimal-leading-zero | lower-roman | upper-roman | lower-greek |
lower-latin | upper-latin | armenian | georgian | lower-alpha |
upper-alpha | none */

ol {margin:.5em; list-style-type:upper-roman} 
ul {margin:.5em; list-style-type:none}
li {margin:0 0 .5em}

div.list   {margin:1em 2em}
div.list p {margin:0 0 .5em; text-indent: 0}
Click image for larger version

Name:	Screenshot 2023-09-12 115340.png
Views:	112
Size:	195.1 KB
ID:	203720

One of the main benefits of using a css sheet is that I only have to change/update/fix the styling in one location and it is applied throughout the document...much faster!

If I wanted to add a list style I could change 'none' to 'disc' on the css file to update all the <ul>s at once, but I'd have to manually add the disc symbol to every paragraph if I used the <div>. (note: there is a way to automatically add the disc image in front of the <p> in each <div> using css but that is beyond the scope of the question and the OP's experience level.)
Click image for larger version

Name:	Screenshot 2023-09-12 120246.png
Views:	104
Size:	103.2 KB
ID:	203721

Last edited by Turtle91; 09-12-2023 at 12:13 PM.
Turtle91 is offline   Reply With Quote