Jump to content

js creat style <li>


Arnold

Recommended Posts

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

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

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

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 by Arnold
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...