Home» Forum» Site Feedback» layout wonderment

layout wonderment

Back to Site Feedback

ive spent the last three hours making a layout and for some reason my general info (general, music, habbies, etcc) will NOT change color of the text to go with my theme. howww do you coder folks figure this out i did it on the easiet setting and im still struggling </3

Idk what your stuff looks like but first thing that came to mind to ask, do you know if you have the colors declared earlier in a var?

@Chillton i don't even know what a var is so i'll get back to u..

@midsunv4mpyr


Usually it'll be stored in something that looks like this, mine for example:

    --headers: whitesmoke;

    --text: whitesmoke; 

    --names: whitesmoke;

    --links: gray;

    --background_image: url('https://files.catbox.moe/1o6aka.png');

    --font-family: "Courier New", cursive;

    --curve: 0px;

    --borders: 2px solid gray;


@midsunv4mpyr a var is a variable, a variable in code is a kind of container fer certain types of data so u can store CSS colors in them like how @Chillton showed! usually u put those variables in a :root selector.

Another thing: why ur color might be overwritten or not applying could be bc of a lot of diff reasons:

  • The selector is wrong. Example: U r trying to get a paragraph but u accidentalyl wrote it wrong or the class wrong.
  • The specificity isnt enough, in CSS u have selectors n hierarchy, next to that CSS stands fer Cascading Stlyesheets, meaning it cascades in order of the way u write ur code so be aware of that!

Expanding on the specificity selectors cuz its best practice to be more specific rather than using the easy yet problematic keyword !important, what i mean w specificity selectors is how SPECIFIC ur writing ur selector. Say fer example u want to make this paragraph element that sits in a div with the class "heading", the color purple.

U could write it like this p { color: purple; }, but that could be very easily overwritten if its not specific enough. Lets add in the div that it sits in! div > p { color: purple; }. We could get even MORE specific: div.heading > p { color: purple; }

Hope this helps bro, if not feel free to IM me ;]

(This is coming from an actual developer who has studied in skool n has an actual job)

@chunta the > symbol is a child selector but u could also leave it out, but it does add specificity. The symbol i used means itll only apply the styling inbetween the curly brackets to paragraphs that are DIRECT children of div elements, so no nested elements. I highly recommend u use W3schools fer any coding n stackoverflow fer common problems n questions!!!

@chunta i just saw this and thank u so much for the in depth explanation!! >.< i'm going to work on it now and see if i'll need to bother you again or not haha 

Hoping this helps somehow!


.details-table td:first-child {

    background: #330033;

    color: #ff66cc;

}

Harley Quinn

It would also probably be more helpful to move this over to the Web & Tech forum, instead of Site Feedback. So more people will see it! 

You must be logged in to reply.