So, I am having this problem where I select an element with css. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

So, I am having this problem where I select an element with css.

If I style the element, the browser is selecting only certain properties and leaving out others.I have tried out everything and I am out of options

14th Jan 2020, 1:56 PM
prime omondi
prime omondi - avatar
7 Answers
+ 1
there may be other css rules that override your #day or h1, still not 100% sure though. best way to find the problem is by using developer tools then go to elements panel. click on the element that doesnt work properly, then see the styles applied to that element. you can see if any of your rules are being overriden
14th Jan 2020, 2:14 PM
Taste
Taste - avatar
0
have any code for us to analyze ?
14th Jan 2020, 1:58 PM
Taste
Taste - avatar
0
One using an id selector for a div element #day { display:flex; flex-direction:column; justify-content:center; } For this element none of the styles are showing.Another is a h1 selector h1{ font-size:30px; font-family: "..."; font-weight:lighter; } for the h1 selector it has only applied the font-family. I have tried clearing cache. Refreshing the browser. Even disabling cache but nothing is working.
14th Jan 2020, 2:09 PM
prime omondi
prime omondi - avatar
0
I am not loading bootstrap that's for sure. Even using !important on all values that weren't loaded isn't working. I have checked the developer tools. At first on the browser the #day selector wasn't showing. It started when I included that selector but after a number of browser refresh all the properties are there and still nothing has changed. I don't understand if its a php file causing it because a php file is directly linked to the css file
14th Jan 2020, 2:26 PM
prime omondi
prime omondi - avatar
0
maybe there's a typo somewhere that makes some rules invalid. or check network panel and see if the css are loaded. but the css properties shouldnt shown in devtools if those are the case. maybe use other browsers and see if its working, or isolate the css file then test every single one of the rules with static plain html page to test if php has something to do with it.
14th Jan 2020, 2:41 PM
Taste
Taste - avatar
0
You were right, a css property was being overriden. The justify-content property for the div element and the rest have just observably been rectified
14th Jan 2020, 2:44 PM
prime omondi
prime omondi - avatar
0
bonjour
15th Jan 2020, 11:29 AM
Bruno peti Jésus
Bruno peti Jésus - avatar