unwanted navigation stack with browser resize - browser
It's my first time here on the forum. I am a beginner in webdesign and encountered a problem I could not find correct answer to. So far I searched for my answer on mutliple sites but the closest to my problem was this;
Horizontal to vertical menu, on browser window resize.
My problem is as followed: my nav ul list gets stacked when I resize my browserwindow to small....I know it must be possible to let it all stay horizontally on a desktopscreen as it is...like on the page of APPLE store for example. I just have no clue what I am doing wrong.
Underneath is my code....hopefully someone can help me and filter out my errors.
HTML
<div id="navcontainer">
<div id="navlist">
<ul>
<li id="active">Home</li>
<li>About</li>
<li>Services</li>
<li>Gallery</li>
<li>Contact</li>
</ul>
</div>
CSS
body {
margin: 200px 0px 10px 0px;
padding: 0px;
text-align: center;
background-image:url(../images/bg.jpg);
background-repeat: repeat;}
/***** HEADER *****/
#header {
width: 900px;
text-align: center;
font-family: Raleway;
font-size: 30px;
font-weight: bolder;
font-variant: normal;
color: rgba(51,51,51,1);
position: absolute;
display: block;
top: 0px;}
/***** NAVIGATION *****/
#navcontainer {
position: relative;
background-image: url(../images/navbar.png);
background-repeat: repeat-x;
height: 37px;
-o-box-shadow: 0em 0.2em 0.3em 0em rgba(51,51,51,0.8);
-moz-box-shadow: 0em 0.2em 0.3em 0em rgba(51,51,51,0.8);
-webkit-box-shadow: 0em 0.2em 0.3em 0em rgba(51,51,51,0.8);
-ms-box-shadow: 0em 0.2em 0.3em 0em rgba(51,51,51,0.8);
box-shadow: 0em 0.2em 0.3em 0em rgba(51,51,51,0.8);
font-family: Raleway;
display: block;
width: 100%; }
#navlist {
float:left;
position:relative;
left:50%;
padding-top: 1.5px;}
#navlist ul {
float:left; /* IE6 needs this */
position:relative;
left:-50%;
list-style:none;
margin: 0 auto;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 100%;
font-style: normal;
font-weight: bolder;
font-variant: normal;
text-decoration: none;
padding: 0px; }
#navlist li {
float:left;
display: inline;
padding-top: 6.8px;
padding-right: 25px;
padding-bottom: 6.8px;
padding-left: 25px;}
#navlist li a {
text-decoration: none;
color: #424242;
padding-top: 6.8px;
padding-right: 19px;
padding-bottom: 6.8px;
padding-left: 19px;}
#navlist li a:hover {
background-image: url(../images/navbar3.png);
background-repeat: no-repeat;
background-position: bottom;
padding-right: 19px;
paddin-left: 19px;}
#navlist li a:active {
background-image: url(../images/navbar1.png);
background-repeat: no-repeat;
background-position: bottom;
border-width: 1px;
border-top-style: inset;
border-right-style: inset;
border-bottom-style: none;
border-left-style: inset;
border-top-color: rgba(102,102,102,1);
border-right-color: rgba(153,153,153,1);
border-left-color: rgba(153,153,153,1); }
#navlist li a:visited {
text-decoration: none;
color: #424242;
padding-top: 6.8px;
padding-right: 0px;
padding-bottom: 6.8px;
padding-left: 0px;}
#navlist li a:focus {
background-image: url(../images/navbar1.png);
background-repeat: no-repeat;
background-position: bottom;
padding-right: 19px;
padding-left: 19px;
border-width: 1px;
border-top-style: inset;
border-right-style: inset;
border-bottom-style: none;
border-left-style: inset;
border-top-color: rgba(102,102,102,1);
border-right-color: rgba(153,153,153,1);
border-left-color: rgba(153,153,153,1);
text-shadow: 1px 1px #FFF, -0.3px -0.3px #000;}
I had this same problem with my navigation. My nav wasn't structured exactly like the solution below but applying the CSS accordingly worked great.
Here is the solution I found.
http://jsfiddle.net/9x7Am/5/
HTML
<ul id='navbar'>
<li><a href='#'> 1 </a></li>
<li><a href='#'> 2 </a></li>
<li><a href='#'> 3 </a></li>
<li><a href='#'> 4 </a></li>
<li><a href='#'> 5 </a></li>
<li><a href='#'> 6 </a></li>
</ul>
CSS
#navbar {margin:0; padding:0; overflow:hidden; width:100%;}
li {width:100%}
li a {padding: 6px 0; float:left; width:16%; text-align:center;}
Related
Want My Hamburger Menu to Have Opaque White Background and Cover Banner
My website has a hamburger menu made with only HTML and CSS. When the hamburger icon is clicked and the menu activated, the menu titles are displayed over the background image instead of having a white background. (The hamburger menu has a transparent background.) How do I make it so that the menu displays OVER whatever is in the background, with its own white background?` <div class="nav"> <h1>MA</h1> <label for="toggle">☰</label> <input type="checkbox" id="toggle"/> <div class="menu"> my work about contact </div> </div> .nav { text-align: right; height: 50px; line-height: 70px; margin-bottom: 20px; margin-top: 15px; font-family: Gothic A1; font-size: 20px; color: black; } .menu { margin: 0 30px 0 0; background-color: white; } .menu a { clear: right; text-decoration: none; color: black; margin: 0 10px; line-height: 70px; padding-left: 30px; } .menu a:hover { color: #edbecb; text-decoration: none; } label { margin: 0 30px 0 0; font-size: 50px; line-height: 70px; display: none; width: 26px; float: right; } #toggle { display: none; } #media only screen and (max-width: 500px) { label { display: block; cursor: pointer; padding-right: 30px; } .menu { text-align: right; width: 100%; /* height: 1000px;*/ display: none; background-color: white; line-height: 50px; margin-top: 0px; padding-right: 30px; } .menu a { display: block; margin: 0; background-color: white; } #toggle:checked + .menu { display: block; background-color: white; position: absolute; } #toggle:checked + .menu a { background-color: white; position: absolute; } #toggle:checked + label { background-color: white; } }
classed image not aligning vertically
My flex container holds three divs, every div has property of flex-grow I have a classed image that does not work on align-items: center; this is the flex container .top-container { display: flex; width: 100% !important; height: 70px; } and this is the container inside .top-notifications { flex-grow: 6; background-color: #F8F9F9; text-align: right; align-items: center; } and the image class is .user-picture { width: 35px; height: 35px; border-radius: 100%; -moz-border-radius: 100%; -webkit-border-radius: 100%; } every elements in boxes are aligned centered but the classed image
body { margin: 0; } .top-container { display: flex; width: 100% !important; height: 70px; } .logo { background-color: #EAFAF1; display:flex; align-items:center; } .top-menu { background-color: #FEF9E7; display:flex; align-items:center; } .top-notifications { flex-grow: 1; display:flex; justify-content: flex-end; align-items: center; background-color: #F8F9F9; } /* top menu */ .top-menu ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #FEF9E7; } .top-menu li { float: left; } .top-menu li a { display: block; color: black; text-align: center; padding: 14px 16px; text-decoration: none; margin: 5px; } .top-menu li a:hover { background-color: #85C1E9; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; margin: 5px; } /* end top menu */ .user-picture { width: 35px; height: 35px; border-radius: 100%; -moz-border-radius: 100%; -webkit-border-radius: 100%; } <div class="top-container"> <div class="logo"><img src="images/logo.png" class="logo" /> </div> <div class="top-menu"> <ul> <li><a class="active" href="#home">Dashboard</a></li> <li>Users</li> <li>Settings</li> </ul> </div> <div class="top-notifications"> Notifications<i class="fa fa-bell-o fa-lg"></i> Reports<i class="fa fa-flag fa-lg"></i> <img src="images/boy.png" class="user-picture" /> </div> </div> align-items:center; is used on the flex parent, not on the flex item itself. See css flex guide
Instagram embeds do not pass W3C Validator
The html code generated by Instagram embeds does not pass the validation at https://validator.w3.org/. Both using the embed button from the website, or using the oembed endpoint produce the same incorrect html: <blockquote class=\"instagram-media\" data-instgrm-captioned data-instgrm-permalink=\"https://www.instagram.com/p/fA9uwTtkSN/?utm_source=ig_embed_loading\" data-instgrm-version=\"12\"style=\" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);\"><div style=\"padding:16px;\"> <div style=\" display: flex; flex-direction: row; align-items: center;\"> <div style=\"background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;\"></div> <div style=\"display: flex; flex-direction: column; flex-grow: 1; justify-content: center;\"> <div style=\" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;\"></div> <div style=\" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;\"></div></div></div><div style=\"padding: 19% 0;\"></div><div style=\"display:block; height:50px; margin:0 auto 12px; width:50px;\"><svg width=\"50px\" height=\"50px\" viewBox=\"0 0 60 60\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><g transform=\"translate(-511.000000, -20.000000)\" fill=\"#000000\"><g><path d=\"M556.869,30.41 C554.814,30.41 553.148,32.076 553.148,34.131 C553.148,36.186 554.814,37.852 556.869,37.852 C558.924,37.852 560.59,36.186 560.59,34.131 C560.59,32.076 558.924,30.41 556.869,30.41 M541,60.657 C535.114,60.657 530.342,55.887 530.342,50 C530.342,44.114 535.114,39.342 541,39.342 C546.887,39.342 551.658,44.114 551.658,50 C551.658,55.887 546.887,60.657 541,60.657 M541,33.886 C532.1,33.886 524.886,41.1 524.886,50 C524.886,58.899 532.1,66.113 541,66.113 C549.9,66.113 557.115,58.899 557.115,50 C557.115,41.1 549.9,33.886 541,33.886 M565.378,62.101 C565.244,65.022 564.756,66.606 564.346,67.663 C563.803,69.06 563.154,70.057 562.106,71.106 C561.058,72.155 560.06,72.803 558.662,73.347 C557.607,73.757 556.021,74.244 553.102,74.378 C549.944,74.521 548.997,74.552 541,74.552 C533.003,74.552 532.056,74.521 528.898,74.378 C525.979,74.244 524.393,73.757 523.338,73.347 C521.94,72.803 520.942,72.155 519.894,71.106 C518.846,70.057 518.197,69.06 517.654,67.663 C517.244,66.606 516.755,65.022 516.623,62.101 C516.479,58.943 516.448,57.996 516.448,50 C516.448,42.003 516.479,41.056 516.623,37.899 C516.755,34.978 517.244,33.391 517.654,32.338 C518.197,30.938 518.846,29.942 519.894,28.894 C520.942,27.846 521.94,27.196 523.338,26.654 C524.393,26.244 525.979,25.756 528.898,25.623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 550.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.743 570.674,65.562 570.82,62.369 C570.966,59.17 571,58.147 571,50 C571,41.851 570.966,40.831 570.82,37.631\"></path></g></g></g></svg></div><div style=\"padding-top: 8px;\"> <div style=\" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;\"> View this post on Instagram</div></div><div style=\"padding: 12.5% 0;\"></div> <div style=\"display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;\"><div> <div style=\"background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);\"></div> <div style=\"background-color: #F4F4F4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;\"></div> <div style=\"background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);\"></div></div><div style=\"margin-left: 8px;\"> <div style=\" background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;\"></div> <div style=\" width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)\"></div></div><div style=\"margin-left: auto;\"> <div style=\" width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);\"></div> <div style=\" background-color: #F4F4F4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);\"></div> <div style=\" width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);\"></div></div></div> <p style=\" margin:8px 0 0 0; padding:0 4px;\"> Wii Gato (Lipe Sleep)</p> <p style=\" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;\">A post shared by Diego Moreno Quinteiro (#diegoquinteiro) on <time style=\" font-family:Arial,sans-serif; font-size:14px; line-height:17px;\" datetime=\"2013-10-03T18:19:39+00:00\">Oct 3, 2013 at 11:19am PDT</time></p></div></blockquote>\n<script async defer src=\"//www.instagram.com/embed.js\"></script> In particular, 2 errors are thrown: "No space between attributes" at rm-version="12"style=" backgro "CSS: font-weight: 550 is not a font-weight value" at p: 8px;"> <div style=" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;"> View Other than making my pages fail validation, it's preventing me from publishing new posts since I have the W3C validation as part of form submission.
My menu bar will not resize when window resizes
I'm having problems with my code. I have a fixed menu bar that works as it should but it doesn't resize when I change the size of the window. I need it to resize because if you change the window size, it will will not scroll horizontally and some buttons are cut off. How can I fix this? Also feel free to make optimization or input on unnecessary code Thanks body { margin: 0px; padding: 0px; background: url(images/gradient.jpg) no-repeat; background-size: cover; background-attachment: fixed; background-position: center; } section { margin: 0 auto; border: 1px solid #000000; border-radius: 8px; background:#E5E7E9; width: 958px; height: 800px; } .bpic { width: 200px; height: 350px; margin: 0px; } .biopic { border: 2px solid #ddd; border-radius: 8px; padding: 5px; width: 200px; height: 350px; margin: 40px 40px 40px 375px; } .bio { margin: 40px; font-family: verdana; text-align: center; } #biography { font-family: arial black; font-size: 120%; text-align: center; border: 2px solid #ddd; border-radius: 8px; padding: 10px; } #assignments { font-family: arial black; font-size: 120%; text-align: center; border: 2px solid #ddd; border-radius: 8px; padding: 10px; } #projects { font-family: arial black; font-size: 120%; text-align: center; border: 2px solid #ddd; border-radius: 8px; padding: 10px; } #contact { font-family: arial black; font-size: 100%; text-align: center; border: 2px solid #ddd; border-radius: 8px; padding: 10px; } .email { border: 1px solid #ddd; border-radius: 8px; padding: 5px; width: 150px; height: 96px; margin: 3px 40px 3px 400px; } .banner { width: 960px; height: 143px; margin: 0 auto; padding: 0px; background: url(images/banner.png) no-repeat; } .banner h2 { font-family: vollkorn; font-size: 350%; color: white; text-transform: uppercase; margin: 0; position: relative; top: -40%; left: 83%; transform: translate(-50%, -50%); } .menu { list-style-type: none; margin: auto; background-color: #333; width: 100%; background: url(images/menu.jpg) repeat-x; position: fixed; min-width: 1080px; z-index: 1; display: inline-block; } .menu ul { float: left; margin: 0px; padding: 0 0 0 30%; list-style: none; } .menu ul li { padding: 0px; display: inline; } .menu ul li a { position: relative; float: center; display: inline-block; height: 30px; width: 180px; text-align: center; padding: 12px 0 0 0; font-size: 13px; font-weight: bold; text-decoration: none; color: #ffffff; outline: none; min-height: 24px; } .menu li a:hover, .menu li .current { position: relative; color: #ffffff; background: url(images/menuhoverright.jpg) top right no-repeat; } .menu li a:hover span, .menu li .current span { position: absolute; display: inline-block; width: 15px; height: 42px; top: 0; left: 0; background: url(images/menuhoverleft.jpg) no-repeat; } .jprop { border: 1px solid #ddd; border-radius: 8px; padding: 5px; width: 200px; height: 195px; margin: 40px; } .jprop:hover { box-shadow: 0 0 2px 1px rgba(0, 140, 186, 0.5); } <!DOCTYPE html> <html> <head> <!-- Homepage My Biography Page Author: Date: 01/29/2017 --> <meta charset="UTF-8" /> <title>Homepage</title> <script src="modernizr-1.5.js"></script> <link href="homestyles.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="menu"> <img src="images/menu.jpg" alt="menu" /> <ul> <li><span></span>Biography</li> <li><span></span>Assignments</li> <li><span></span>Projects</li> <li><span></span>Contact</li> </ul> </div> <div class="banner"> <img src="images/banner.png" alt="banner" /> <h2>K V</h2> </div> <section> <div id="biography"> <a name="biography"><h1>Biography</h1> </div> <div class="biopic"> <img src="images/biopic.jpg" width="230" height="490" alt="biopic" class="bpic"/> </div> <article> <div class="bio"> <p>Hello, my name is &&&&&&. -- </p> <p>I am currently pursuing my A.S. degree in computer information technology at?I plan to start working in the field of IT, once I obtained my A.S. degree and certifications. While working, I plan on continuing my education to obtain my bachelor’s degree in IT at UCF. I have always had a passion for technology, especially computers. To be able to work in the field that I enjoy is one of my life goal. </p> </div> </article> </section> <br> <section> <div id="assignments"> <a name="assignments"><h1>Assignments</h1> </div> <div class="jprop"> <a href="Jprop/basic.html"> <img src="images/jprop.JPG" alt="jprops"> </a> </div> </section> <br> <section> <div id="projects"> <a name="projects"><h1>Projects</h1> </div> </section> <br> <section style="max-height: 210px;"> <div id="contact"> <a name="contact"><h1>Contact</h1> </div> <div class="email"> <a href="mailto:REDACTED"> <img src="images/email.png" alt="emails"> </a> </div> </section> <br> </body> </html>
This bit of css from your style sheet is going to keep the menu from resizing below 1080px. So it will be too wide for many tablets and phones for example. .menu { min-width: 1080px; } Remove the min-width property, and see if that fixes it for you.
FlipSwitch style in Xpages
I would like to create a checkbox that looks like flipswitch. I used this CSS classes. and I used this design elements. But I could not succeded. There is something that i missed. I do not know how to manage that? Codes in XPages: <div class="onoffswitch"> <xp:checkBox text="Label" id="onoffswitch" defaultChecked="true"> <span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span> </xp:checkBox> </div> CSS Class: Resources\Style Sheets .onoffswitch { position: relative; width: 90px; -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none; } .onoffswitch-checkbox { display: none; } .onoffswitch-label { display: block; overflow: hidden; cursor: pointer; border: 2px solid #999999; border-radius: 20px; } .onoffswitch-inner { display: block; width: 200%; margin-left: -100%; transition: margin 0.3s ease-in 0s; } .onoffswitch-inner:before, .onoffswitch-inner:after { display: block; float: left; width: 50%; height: 30px; padding: 0; line-height: 30px; font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold; box-sizing: border-box; } .onoffswitch-inner:before { content: "ON"; padding-left: 10px; background-color: #34A7C1; color: #FFFFFF; } .onoffswitch-inner:after { content: "OFF"; padding-right: 10px; background-color: #EEEEEE; color: #999999; text-align: right; } .onoffswitch-switch { display: block; width: 18px; margin: 6px; background: #FFFFFF; position: absolute; top: 0; bottom: 0; right: 56px; border: 2px solid #999999; border-radius: 20px; transition: all 0.3s ease-in 0s; } .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner { margin-left: 0; } .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { right: 0px; }
I find that when you need to put markup inside a control it mostly won't work because the XPages rendering will change or ignore it. To get around this I use plain markup with a hidden control located outside of the markup. I manage the state of the hidden control with JQuery. Here is a working example for your FlipSwitch: <xp:checkBox text="Label" id="checkBox1"></xp:checkBox> <div class="onoffswitch"> <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" onclick="x$('#{id:checkBox1}').prop('checked', !(x$('#{id:checkBox1}').prop('checked')) )" /> <label class="onoffswitch-label" for="myonoffswitch"> <span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span> </label> </div> The x$() function is a handly utility from Mark Roden: function x$(idTag, param){ //Updated 18 Feb 2012 idTag=idTag.replace(/:/gi, "\\:")+(param ? param : ""); return($("#"+idTag)); }