Off Topic > Off Topic

Why is there no margin applied to the bottom/top?

Pages: << < (2/2)

Foxscotch:


--- Quote from: Master Matthew² on February 19, 2017, 01:28:59 PM ---.bannertext supercedes the styles you gave to the individual tag you're showing there.

--- End quote ---
literally no. more specific selectors take precedence
--- Quote from: espio100 on February 19, 2017, 01:30:26 PM ---in the image at the inspect code part you can clearly see there is 20 pixels of margin applied to every direction. However on the site itself its only applied to the left and right side.
All I want really is a few pixel of space at the bottom where the black background goes a little further then the text and I tried doing so by adding a little bit of margin. Just like I did at the h1 element, where it worked. but somehow it doesnt work at the a element.

--- End quote ---
add 20px padding to all sides of the box, and remove the extra margins/padding for anything in it

.bannertext {
  padding: 20px;
}

then you can add margin-top to the smaller text if needed to space it from the heading

espio100:


--- Quote from: Master Matthew² on February 19, 2017, 01:28:59 PM ---.bannertext supercedes the styles you gave to the individual tag you're showing there.

You only have left and right padding because .bannertext only has left and right padding.

--- End quote ---
What
Style that are lower then the original one override the original one
or however the forget im supposed to explain it

Basically when you get ".this a color:red;" and you write the ".this a color:blue" a few lines further the color will be blue because it overrides the original red.
A elements are actually blue by default but piss off the doesnt matter


--- Quote from: Foxscotch on February 19, 2017, 01:32:42 PM ---literally no. more specific selectors take precedenceadd 20px padding to all sides of the box

.bannertext {
  padding: 20px;
}

--- End quote ---
Oh cool thanks <3

Pages: << < (2/2)

Go to full version