CSS CSS Basics Understanding Values and Units Percentages

Sandeep Singh
Sandeep Singh
3,582 Points

text-alignment

Hi, i am facing a problem in text-alignment . The alignment of header' , footer's and list item are different. Text of header and footer are looking in center of the page but the text of list item's which is in the middle of the page are bit right side than header and footer's text. I have used wrapper technique as well to make all the the text in the center of the page but its not working.

Thanks

2 Answers

Ezra Siton
Ezra Siton
12,621 Points

You must add code (codepen or workspace) its imposibble to know "why" without code.

Inspect styles: https://developers.google.com/web/tools/chrome-devtools/inspect-styles/

Anyway more specific wins. Check if this is your case https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity

Jamie Reardon
Jamie Reardon
Treehouse Project Reviewer

As Ezra said, but from what I read, it sounds like you have the default styling on your ul/ol element still intact.

Use this piece of code in your CSS to see if it removes that and perfectly centers the content in line with the rest.

Remember to replace the element selector that matches your element in your html, e.g. if you have an unordered list (ul) use the ul tag in the css as the selector, vice versa for ordered list (ol).

ul {
margin: 0;
padding: 0;
}