Trying to get my backround and image neat but it wont work
38 Replies
i want the bg dark gray aswell
when i try putting the background-color in *{} it changes the text background aswell
this is what happens
i though it was something like this
add this to your css:
You should use * {} sparingly, it's better to set things where you need them. The reset you have is alright, but don't put stuff like background color in there
This would select any elements that are a child of some element and have a text attribute, it's not really something you'd want to do in general
And then for the twitch icon to appear in the center
So its like got the same spacing around every side
you've done some odd stuff to get everything positioned, if I'm honest. It's kinda hard to figure out why things are working the way they are in your example
Right, so add this at the top of your CSS:
Then change the section selector at the bottom to this:
You can remove the
/* commented out */
things, I just put them in there because you probably don't want those. Position: absolute is kind of a last resort a lot of the time
you can change the body selector I shared earlier
margin: 0 auto;
will set the top and bottom margins of the section to 0, then set the left and right ones to auto, which centers block level elements with less than 100% width
if all you're doing is adding an image though, you may want to just use the <img> tag instead of using <section> with a background image
or do you mean top and bottom as well, so centered free in the middle of the screen?yeah
try this
did you fix it?
no
i want a gap between the navbar and the twitch logo
@althepal78 u recon u can help with that?
put a margin top
or if you have a flex or grid you can put a gap: 1rem;
oh yeah cool
then i want to make it so that the purple bit is cut so its only like 10 px above the words twitch
?
use paint and edit the image
like crop the image
did you download the image?
ms paint, the gimp, photoshop, google photos, krita, online tools... there's a thousand good ways to crop an image
photoshop lmao
paint, powerpoint
your phone
now the image is very pixelated and ugly
that's because you're stretching an image that is now much smaller
dude how did you originally get it and why did you shrink it lol
you have to find a higher resolution version of the twitch logo, or accept the purple borders being the size they are
you can youtube how to crop an image
ive just done this
my button styling isnt working
it's best to make a new post. You can share the same codepen if you update it, but you'll have to describe the problem more than "doesn't work"
can u please tell me how to make a nice red bordered button with a red filling when i hover over it and in white text
in a new post, sure
its not that deep bro
don't call me bro please
ok homie
idk what to call you
im used to saying bro you know
we try to limit posts to one topic, because if someone else might have a similar issue, it's impossible to find something buried three issues deep in a post about background images if the thing you're looking for is how to style buttons
fair enough just created a new thread