Arnold Posted August 27, 2021 Share Posted August 27, 2021 Hello pls How i have to format style <li> with color white or any: document.body.getElementById("li").style.Color = "#000000"; See the webpage Menu <script> switch (new Date().getDay() % 2) // { default: document.body.classList.add("day-even"); function display() { var co=document.getElementById("li"); co.style.color="red"; } OR: // document.getElementById("li").style.Color = "red"; document.write('<center><img src="https://arenas.pagesperso-orange.fr/GradientExample/eesti.png" style="height:80px; width:130px;"></center>'); document.body.style.scrollbarFaceColor="#084b8a" document.body.style.scrollbarArrowColor="#000000" document.body.style.scrollbarTrackColor="" document.body.style.scrollbarShadowColor="" document.body.style.scrollbarHighlightColor="colorname" document.body.style.scrollbar3dlightColor="" document.body.style.scrollbarDarkshadowColor="colorname" // [url=https://]This be ![/url] break; case 0: document.body.classList.add("day-odd"); document.body.getElementById("li").style.Color = "#000000"; document.body.write('<center><img src="https://arenas.pagesperso-orange.fr/GradientExample/ukraine.png" style="height:80px; width:130px;"></center>'); document.body.style.scrollbarFaceColor="#005bbb" document.body.style.scrollbarArrowColor="#ffd500" document.body.style.scrollbarTrackColor="#005bbb" document.body.style.scrollbarShadowColor="#ffffff" document.body.style.scrollbarHighlightColor="colorname" document.body.style.scrollbar3dlightColor="colorname" document.body.style.scrollbarDarkshadowColor="colorname" break; } </script> Thanks for your help Arnold Link to comment Share on other sites More sharing options...
Ingolme Posted August 27, 2021 Share Posted August 27, 2021 I don't fully understand what you're trying to achieve, but Javascript is not the best way to do it. You should use CSS instead. W3Schools has a CSS tutorial here: https://www.w3schools.com/css/default.asp Link to comment Share on other sites More sharing options...
Arnold Posted August 28, 2021 Author Share Posted August 28, 2021 Hello Sir Thank's for your reply I have: document.body.classList.add("day-even"); and document.body.classList.add("day-odd"); Wath is the parameter to change the style color for the all tag <li></li> This is not work: document.getElementById("li").style.Color = "red"; With css i dont have also any echo: li.day-odd #nav {color:#33CC33;} li.day-even #nav {color:#FF0000;} Thank's Arnold Link to comment Share on other sites More sharing options...
Ingolme Posted August 28, 2021 Share Posted August 28, 2021 Your CSS selectors are incorrect. You need to learn CSS properly. This will probably work, but I haven't verified what your HTML structure is. .day-odd li { color:#33CC33; } .day-even li { color:#FF0000; } li a { color: inherit; } Link to comment Share on other sites More sharing options...
Arnold Posted August 28, 2021 Author Share Posted August 28, 2021 Sir, thank's for your reply For you proposition, the stuff <il> is insensible. But the <ul> changet the color. The menu @r Link to comment Share on other sites More sharing options...
Ingolme Posted August 28, 2021 Share Posted August 28, 2021 I don't know what you are trying to achieve. I see that the text color of the list items has been successfully changed on your website. Link to comment Share on other sites More sharing options...
Arnold Posted August 28, 2021 Author Share Posted August 28, 2021 (edited) hello Sir! i m so sorry for you Wath you see? The <ul> is green and the <li> is black pls, i need white. you stuff is: also "li" is never change the color. Black is the origine color Waith up, tomorrow (after 00:00, you see the background color (country flag) will change [odd/even]: "white" is the best issu for me Thank's Sir @r Edited August 28, 2021 by Arnold Link to comment Share on other sites More sharing options...
Ingolme Posted August 28, 2021 Share Posted August 28, 2021 The stylesheet "table.css" is changing the colors. Also, one of the <li> elements has a style="color:black" attribute which forces the color to be black. We need to override these. This code will probably solve that: .day-odd li ul li { #33CC33 !important; } .day-even li ul li { color: #FF0000 !important; } .menu li ul li a { color: inherit; } This code is messy, but it is the only way to override table.css and your current HTML structure. You probably should learn CSS. If you did, then you would be able to analyze the problem and write the correct code without help. Link to comment Share on other sites More sharing options...
Arnold Posted August 28, 2021 Author Share Posted August 28, 2021 Sir All is ok now. Many thank's to you for your help @r The complet Menu Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now