This forum is now read-only. Please use our new forums at discuss.codecademy.com.

CSS Selectors Forum

View Course

222 points
1e8ecff815bf7f22dfcbf991ffb7c2b9?s=140&d=retro
Submitted by
compudime
over 3 years ago

Why Do the numbers and bullets from my list stay on the left when I center align all text?

Hi,

I'm still pretty new at this so maybe I'm just missing a minor rule or detail....

I'm trying to set my text alignment to center by writing:
*}
text-align: center;
}

All text gets centered on page, but for some reason the numbers and bullets from my lists stay on the left.

I know there must be a simple solution for this, so if anyone can please help my out, I'd greatly appreciate it.

Thanks


0 votes

permalink

index of css/test/defaults. There are five links in this index. Open each in a new tab and then go through them carefully and soak them in. Starting from this point will make answering your question a lot easier.

Google SERP: default style sheet in a browser

Let us know when you're ready to continue the discussion. No, I'm not trying to be patronising; this really is a detailed topic with a horde of variations and surprises. The list in HTML is indeed a beast in nice clothing. We do need to understand it to tame it.

There are numerous discussions on lists dating all the way back to the birth of the internet and www, and earlier relating to SGML and the birth of HTML. Anyone who had a Mac in the 80s probably had a version of HyperCard which introduced the idea of hyperlinked 'cards' and markup language to a generation of new enthusiasts. We can trace it even further back to the invention of word processors. Remember WordPerfect and 'reveal codes'?

The site A List Apart is prominent in this SERP: taming the list. Many of the articles date back a good deal to a time when there were a lot of discussions and ideas floating around. This is a good foundation to build upon. Learning this stuff backwards does not work.

8298 points
5958b8ebe12813a2a3000034_980106998
Submitted by
Roy
over 3 years ago

1 Comment

593d545c83696644420003b7_64554016 stetim94 over 3 years ago

really nice, the default stylesheet i have been looking for it for quite a while. i noticed the body {margin: 8px} which annoyed me