Jump to content

emmaspeedy

Members
  • Posts

    2
  • Joined

  • Last visited

emmaspeedy's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hi, guys I have a little question. i have a top navigation bar with two LI tags "HOME" and "PRODUCTS". The LI tag products have a dropdown list. My navbar and drop down work perfectly but i wanted to fallow the steps on W3school to make it responsive for other screen that are more little. I fallow the steps so I add .topnav to the CSS i have already : BEFORE ul { list-style-type: none; margin: 0; padding: 0; background-color: #333; overflow: hidden; border-radius: 10px; font-family:"Comic Sans MS", cursive, sans-serif; } li { float: left; border-right: 1px solid #bbb; } li:last-child { border-right: none; } li a, .dropbtn{ display: block; color: whitesmoke; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover, .dropbtn:hover .dropbtn { background-color: #cc0000; color: whitesmoke; } AFTER body { margin: 0; } ul.topnav{ list-style-type: none; margin: 0; padding: 0; background-color: #333; overflow: hidden; border-radius: 10px; font-family:"Comic Sans MS", cursive, sans-serif; } ul.topnav li { float: left; border-right: 1px solid #bbb; } ul.topnav li:last-child { border-right: none; } ul.topnav li a, .dropbtn{ display: block; color: whitesmoke; text-align: center; padding: 14px 16px; text-decoration: none; } ul.topnav li a:hover, .dropbtn:hover .dropbtn { background-color: #cc0000; color: whitesmoke; } but somehow its dont work. When i add the ul.topnav my CSS for the UL tag it doesnt appear at all so i tought that the problem is with the drop down classes that I have can someone explain me how to place everything so I can user my CSS plus the topnav class to make it reponsive ? here is the css for the droop down .dropdown-content { display: none; position: absolute; background-color: whitesmoke; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); } .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; text-align: left; } .dropdown-content a:hover { background-color: #cc0000; } .dropdown:hover .dropdown-content { display: block; } P.S : for the nav bar and dropdown I fallowed the W3school steps
  2. HI, I have a little question for you guys. I want to display de date thanks to Javascrip. I can display it but !!! it display this --> 2015313 and i want this --> 2015/3/13 how can introduce the " / ". I have try everything but nothing seems to work. Here is that I have now : <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script type="text/javascript"> function InstallHeader( NomPage ) { document.getElementById("Entête").innerHTML=NomPage; } function InstallDate( ) { var a = new Date().getFullYear(); var m = new Date().getMonth(); var j = new Date().getDate(); document.getElementById("Date").innerHTML+=a; document.getElementById("Date").innerHTML+=m; document.getElementById("Date").innerHTML+=j; } </script> <style> #Entête { padding-left:2%; background-color:lightgray; width:85%; float:left; } #Date { background-color:lightblue; width:13%; float:left; text-align:center; } </style> </head> <body> <div id="Entête"> </div> <div id="Date"> </div> <script type="text/javascript"> InstallHeader("Titre de la page"); InstallDate();</script> </body> </html>
×
×
  • Create New...