Yeah. That's right.
If you would do p.yourclass it would look for a p tag with this class, but if you had a space between p .yourclass it would look for an element with class yourclass inside a paragraph
i'm working through a css course, and for some reason i have .item p for a class. i'm guessing p means that the item class only apply to paragraphs, but im not sure?
.item p will look for a paragraph inside an element that has class "item" Example
<div class="item">
<p>Some Text</p>
</div>
If you wanted to apply style to a p tag that has specific class it would then be p.yourclass This would match
<p class="yourclass"></p> but not <div class"yourclass"></div>
.item ...
so p.yourclass would be more selective than just .yourclass p? p.yourclass would apply to only p tags with the yourclass class, and .yourclass p would apply to all p tags in said area?
margin-left:auto;
margin-right:auto;
You can just do
margin-inline:auto;
This is called a "Logical Property" you should take a look at other logical properties.
margin-inline is margin on left and right, margin-block is margin on top and bottom
but margin-inline and margin-block is also shorthand properties.
margin-inline is shorthand for margin-inline-start which is left margin
and margin-inline-end which is right margin.
but margin-inline would not really make a difference since it puts the same margin on both sides.
And let's say you want 10px margin on left and 20px margin on right, you could do margin-inline:10px 20px; instead of using both margin-inline-start and margin-inline-end Please login to reply to this topic
Cookies and similar technologies are used on our sites to personalize content and ads. You can find further details and change your personal settings below. By clicking OK, or by clicking any content on our sites, you agree to the use of these cookies and similar technologies.
When you visit any of our websites, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and manage your preferences. Please note, that blocking some types of cookies may impact your experience of the site and the services we are able to offer.