Jump to content

Typo in W3Schools Example?


yottaflop

Recommended Posts

http://www.w3schools.com/css/tryit.asp?fil...ound_shorthand2In this example, we have a .container class that defined centered text.Next, we have a div of class .center_div.Not only are the class names swapped from what they should be (.container defines centering and .center_div defines a container), but .container is being overwritten anyway.I remember first seeing this example and being rather confused.
Link to comment
Share on other sites

:) I have no idea what you're talking about. .container is a class which applies text-align: center on any inline elements within it..center_div is a class which that in this case is applied to a div and gets centered within the container (while taking into consideration the 200px left margin applied to the body). This class specifies the styles of the elements within it. Container contains a div which centered. Center_div defines the styles for a centered div and has its own properties for defining the styles of the content within it specifically. The names seem apt to me. Nothing is being overwritten, and in fact, could you explain what you mean by that?
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...