I have an issue related to css viewing of webview on Android 4.0.4
I have an list : using <ul> , <li> tags.
But when show on tablet 7 inches, some <li> has a different border size (> 1px).
Here is html :
<div id="cmSettingMenuList">
<ul>
<li >11111111</li>
<li >2222222</li>
<li >33333333</li>
<li >11111111</li>
<li >2222222</li>
<li >33333333</li>
<li >11111111</li>
<li >2222222</li>
<li >11111111</li>
<li >2222222</li>
<li >33333333</li>
<li >33333333</li>
<li >11111111</li>
<li >2222222</li>
<li >33333333</li>
</ul>
</div>
I use 1 css for it:
#cmSettingMenuList ul {
width: 580px;
list-style: none;
overflow: visible;
}
#cmSettingMenuList ul li {
padding-left: 2px;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #9AB2E7;
background-size: 26px;
position: relative;
}
Here is display on tablet:
http://i.stack.imgur.com/RBsBL.png
It's not same size.
Do you have any solution for it.
THANKS
Related
Hello and thanks in advance for the help. Here's a link to the site in question: caulfield.co/test/originals.html
I'm attempting to create a responsive navbar in which the current dropdown-items appear as the standard nav-items after collapse.
See this image:
The dropdown-items are displaying as intended on desktop. On mobile, however, the separate dropdown is unnecessary. Here is how it displays with Bootstrap 4 out of the box:
Does anyone know of a convenient or custom solution to remove the dropdown once the navbar-collapse is in use on mobile etc such that the dropdown-items appear just like the navbar-items? Ideally, the "More" nav-link would display:none and the nav-items would continue from "Contact" to "Works On Display" seamlessly.
HTML:
<nav id="navHome" class="navbar navbar-expand-lg navbar-light sticky-top">
<div class="container-fluid max-width-940">
<a class="navbar-brand" href="index.html">
<img src="images/mb.svg" alt="Margaret Biggs" width="220px"/>
</a>
<button class="navbar-toggler togglerNoBorder" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse backgroundWhite" id="navbarNavDropdown">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="bio.html">Bio <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="originals.html">Originals</a>
</li>
<li class="nav-item">
<a class="nav-link" href="exhibition.html">Exhibition</a>
</li>
<li class="nav-item">
<a class="nav-link" href="prints.html">Prints</a>
</li>
<li class="nav-item">
<a class="nav-link" href="professionals.html">For Professionals</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</li>
<li class="nav-item dropdown navDropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
More
</a>
<div class="dropdown-menu navDropdown" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="works-on-display.html">Works on Display</a>
<a class="dropdown-item" href="poetry.html">Poetry</a>
<a class="dropdown-item" href="commissions.html">Commissions</a>
<a class="dropdown-item" href="blog.html">Blog</a>
</div>
</li>
</ul>
</div>
</div>
</nav>
CSS:
.navbar-right {
float:right;
}
.togglerNoBorder{
border: 0px solid transparent;
}
.nav940{
max-width:940px;
margin:0 auto;
}
#navHome {
color:rgb(34, 34, 34);
font-size:13px;
font-weight:400;
line-height:16px;
text-transform:uppercase;
background-color:white;
height:60px;
box-shadow: 0 0 18px -4px #000;
}
#navHome a{
color:rgb(34, 34, 34);
}
#navHome a:hover{
color:#165fa5;
}
.navDropdown {
font-size:13px;
}
.navDropdown a:hover {
background-color:white;
}
.backgroundWhite{
background-color:white;
}
.nav-item{
padding-left:10px;
}
.dropdown-item {
padding-top:10px;
}
.navbar-brand {
margin-bottom:3px;
}
.dropdown-menu {
top:45px;
}
Use a #media query for mobile (<992px) to show the dropdown-menu as normal nav-links...
#media (max-width: 992px) {
.dropdown-toggle {
display: none;
}
.dropdown-menu {
display: block;
position: relative;
border-width: 0;
padding: 0;
margin: 0;
}
.dropdown-item {
padding: .5rem 0rem;
color: rgba(0,0,0,.5);
}
}
https://www.codeply.com/go/lAAQOwhAx0
Based on the excellent answer by #Zim, I modified the style a bit to fit one by side in a dark navbar. Tested with Bootstrap 5, but I guess it should work in Bootstrap 4 as well.
#media (max-width: 992px) {
.dropdown-toggle {
display: none;
}
.dropdown-menu {
position: relative;
display: contents;
border-width: 0;
padding: 0;
margin: 0;
color: transparent;
}
.dropdown-item {
color: white;
background-color: black;
display: inline;
}
}
Hi to everyone I have a strange problem with Firefox 46, before the update my website work good, now if I go over the slider on top page it doesn't show me the custom cursor and if I click on it doesn't work the jquery function too.
On chrome, safari and also on the old version of FF it work; it's seems it can't see the div #banner because it's a child of others div containers, but why on the old version it work?
I'm confused
here's the test page
HTML code
<div class="parallax">
<header>
<div id="cont_logo">
<a class="logo" href="" rel="home"></a>
<span>L'étoile</span>
<span id="logo_text">Ristorante - Pizzeria - Steak House</span>
<span>Courmayeur</span>
</div>
<nav id="menu_lang">
<ul>
<li class="selected"><a href="" title="ita" >It</a></li>
<li><a href="" title="fra" >Fr</a></li>
<li><a href="" title="eng" >En</a></li>
</ul>
</nav>
<nav id="main_menu">
<ul>
<li>Home</li>
<li class="selected">Ristorante</li>
<li>Menu</li>
<li>Courmayeur</li>
<li>News</li>
<li>Gallery</li>
</ul>
</nav>
</header>
<div class="parallax__group">
<div class="parallax__layer parallax__layer--base">
<div id="banner">
<ul>
<li><img src="images/banner1.jpg" alt="" /></li>
<li><img src="images/banner2.jpg" alt="" /></li>
<li><img src="images/banner3.jpg" alt="" /></li>
<li><img src="images/banner4.jpg" alt="" /></li>
</ul>
</div>
</div>
<div id="overlayer">
<h2>Ristorante</h2>
</div>
</div>
CSS code
#banner{
width:100%;
overflow:hidden;
z-index:0;
position:relative;
top:0;
left:-4px;
}
#banner:not(.home):hover{cursor:url("img/zoom.cur"), auto;}
.parallax {
height: 100%;
overflow-x: hidden;
overflow-y: auto;
perspective: 1px;
width: 100%;
}
.parallax__layer--base {
bottom: 0;
left: 0;
position: relative;
right: 0;
top: 0;
transform: translateZ(-1px) scale(2);
}
.parallax__layer--back {
transform: translateZ(0px);
}
.parallax__layer--content {
position: relative;
}
.parallax__group {
position: relative;
height: 100vh;
transform-style: preserve-3d;
}
JQuery code
function zoom_banner(){
$( "#banner" ).click(function() {
$("#testa_pag, #overlayer").toggleClass('open');
});
}
I'm trying to create a 3 column responsive footer where in case of small window size I want each div "foo_col" to shown downt to first div.ie
foo_col_1
foo_col_2
foo_col_3
---HTML code-----
<footer>
<section class="layout">
<div class="foo_row">
<div class="foo_col">
<ul class="nav">
<li><i class="icon-home"></i>Home</li>
<li><i class="icon-question-sign"></i>About Us</li>
<li><i class="icon-h"></i>Sign In</li>
<li><i class="icon-heart"></i>Register</li>
</ul>
</div><!-- foo_col_1 -->
<div class="foo_col">
<ul class="nav">
<li>All Location</li>
</ul>
</div><!-- foo_col_2 -->
<div class="foo_col">
<ul class="nav">
<li><i class="icon-keyboard"></i>Contact Us</li>
</ul>
</div><!-- foo_col_2 -->
</div><!-- foo_row -->
</section><!-- section -->
</footer><!-- footer -->
Need to enhance sass code to take care of small sized window. Currently on resizing the window footer links are not aligning properly.
------footer sass-----
footer{
width: 100%;
height: 200px;
background: lighten($darkgray, 25);
#include at-breakpoint($medium){
text-align:center;
overflow: hidden;
}
ul.nav{
li{
a{
color :$darkblue;
font-size: .8em;
padding: 5px 10px;
}
}
}
}//footer
I want to create a 3 layer li ul menu but the 3 layer is covering the second layer. Can someone help me to align the 3 layer just right next to the second layer?
I very much appreciate your comments!
Best,
W
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<HEAD><title>bla</title>
<style type="text/css">
ul {
font-family : Arial, Verdana;
font-size : 18px;
font-weight: bold;
margin : 0;
padding : 0;
list-style : none;
z-index: -10;
}
ul li {
display : block;
position : relative;
float : left;
}
li ul {
display : none;
position : relative;
}
ul li a {
display : block;
text-decoration : none;
color : #ffffff;
border-top : 0 solid #ffffff;
padding : 6px 25px 6px 25px;
background : #033a96;
margin-left : 0;
white-space : nowrap;
}
ul li a:hover {
background : #9092c7;
}
li:hover ul {
display : block;
position : absolute;
z-index: 10;
}
li:hover li {
float : none;
font-size : 14px;
z-index: 10;
}
li:hover a {
background : #9092c7;
z-index: 10;
}
li:hover li a:hover {
background : #033a96;
z-index: 10;
}
</style>
</head>
<body >
<TABLE border=0 align="center" cellPadding=0 cellSpacing=0 valign="top">
<TBODY valign="top">
<TR valign="top">
<TD width="100%" bgcolor="#FFFFFF">
<TABLE height=19 valign="top" cellSpacing=0 cellPadding=0 width="100%" border=0>
<tr>
<td height=35 bgcolor="#033a96" >
<div id="menu_about" style="position: relative; z-index: 10;">
<ul id="menu">
<li ><a class="link" href="index.htm" >Layer 1</a>
<ul>
<li >Layer 2 blblb</li>
<li >Layer 2</li>
<ul >
<li >Layer 3 Layer 3 Layer 3 Layer 3 </li>
<li >Layer 3 Layer 3 Layer 3 Layer 3 </li>
</ul>
<li>Layer 2</li>
<li>Layer 2</li>
<li>Layer 2</li>
</ul>
</li>
<li><a class="link" href="#about" data-link="second">Layer 1</a>
<ul>
<li >Layer 2 blblb</li>
<li >Layer 2</li>
<ul >
<li >Layer 3 Layer 3 Layer 3 Layer 3 </li>
<li >Layer 3 Layer 3 Layer 3 Layer 3 </li>
</ul>
<li>Layer 2</li>
<li>Layer 2</li>
<li>Layer 2</li>
</ul>
</li>
</div>
</td>
</tr>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</BODY>
</HTML>
I very much suspect you are using a WYSIWYG (like Dreamweaver) to generate your code?
Two notes on this:
Try to avoid inline styling
Don't use table-based lay-out except for tabular data. Use divs, nav, footer, header, and aside elements
For your solution:
Removed all the z-indexes, they aren't needed
You forgot to nest the 3rd level ul's in a second level li
Try to set properties like font-size on normal state elements, not hover (doesn't change)
I would advise naming your ul's and li's, or at least putting them in a logical order in your css, because this is quite messy.
The most important part that fixes your navigation is this css I added
ul li ul li ul {
margin-left: 100%;
}
It sets your nested ul's and their children's margin to the parent div's width.
So here is your complete new css:
ul {
font-family : Arial, Verdana;
font-size : 18px;
font-weight: bold;
margin : 0;
padding : 0;
list-style : none;
}
ul li {
display : block;
float : left;
}
ul li ul li ul {
margin-left: 100%;
}
li ul {
display : none;
}
ul li a {
display : block;
text-decoration : none;
color : #ffffff;
padding : 6px 25px 6px 25px;
background : #033a96;
white-space : nowrap;
}
ul li a:hover {
background : #9092c7;
}
li:hover ul {
display : block;
position : absolute;
}
li li {
float : none;
font-size : 14px;
}
li:hover a {
background : #9092c7;
}
li:hover li a:hover {
background : #033a96;
}
And your html (only the relevant part):
<div id="menu_about" style="position: relative; z-index: 10;">
<ul id="menu">
<li ><a class="link" href="index.htm" >Layer 1</a>
<ul>
<li>Layer 2 blblb</li>
<li>Layer 2</li>
<li>Layer 2
<ul >
<li >Layer 3 Layer 3 Layer 3 Layer 3 </li>
<li >Layer 3 Layer 3 Layer 3 Layer 3 </li>
</ul>
</li>
<li>Layer 2</li>
<li>Layer 2</li>
</ul>
</li>
<li><a class="link" href="#about" data-link="second">Layer 1</a>
<ul>
<li >Layer 2 blblb</li>
<li >Layer 2
<ul >
<li >Layer 3 Layer 3 Layer 3 Layer 3 </li>
<li >Layer 3 Layer 3 Layer 3 Layer 3 </li>
</ul>
</li>
<li>Layer 2</li>
<li>Layer 2</li>
<li>Layer 2</li>
</ul>
</li>
</ul>
</div>
I have some padding and margin "errors" in firefox that I haven't figured out yet.
This is the test page where the screw-ups are happening.
This is the code for the HTML/CSS for the black caption box:
#caption{
position:relative;
display:block;
margin: -4px 0 0 0;
width: 650px;
height:68px;
background-color: black;
}
<div>
<div id="slider2">
<div>
<img src="img/urban.jpg" />
</div>
<div>
<img src="img/urban2.jpg" />
</div>
<div>
<img src="img/urban3.jpg" />
</div>
</div>
<div id="caption"></div>
</div>
This is the schedule code too:
#schedule{
height: 500px;
background-color: #ededed;
padding: 10px 10px 0px 10px;
}
#schedule h2{
text-align: center;
font-family: Arial;
color: rgba(0,0,0,.7);
}
.away{
color: red;
}
.gameline{
border-bottom: 1px solid rgba(0,0,0,.4);
}
.lineup > li{
margin: 0 0 7px 0;
}
#date{
margin: 20px 0 0 0;
list-style:none;
width: 70px;
float:left;
padding-right:30px;
font-family: 'Esteban', serif;
font-family: Arial;
font-weight: bold;
}
#date > .gameline{
border-bottom: 1px dashed rgba(0,0,0,0);
}
#opponent{
margin: 20px 0 0 0;
font-family: 'Esteban', serif;
font-family: Arial;
list-style:none;
}
<div id="right">
<div id="schedule">
<h2>2012 Schedule</h2>
<ul id="date" class="lineup">
<li>APR. 21</li>
<li class="gameline"></li>
<li>SEPT. 1</li>
<li class="gameline"></li>
<li>SEPT. 8</li>
<li class="gameline"></li>
<li>SEPT. 15</li>
<li class="gameline"></li>
<li>SEPT. 22</li>
<li class="gameline"></li>
<li class="away">SEPT. 29</li>
<li class="gameline"></li>
<li>OCT. 6</li>
<li class="gameline"></li>
<li class="away">OCT. 13</li>
<li class="gameline"></li>
<li>OCT. 20</li>
<li class="gameline"></li>
<li class="away">OCT. 27</li>
<li class="gameline"></li>
<li>NOV. 3</li>
<li class="gameline"></li>
<li>NOV. 10</li>
<li class="gameline"></li>
<li class="away">NOV. 17</li>
<li class="gameline"></li>
<li>NOV. 24</li>
</ul>
<ul id="opponent" class="lineup">
<li>Scarlet & Gray Game</li>
<li class="gameline"></li>
<li>Miami(Ohio)</li>
<li class="gameline"></li>
<li>Central Florida</li>
<li class="gameline"></li>
<li>California</li>
<li class="gameline"></li>
<li>UAB</li>
<li class="gameline"></li>
<li class="away">Michigan State</li>
<li class="gameline"></li>
<li>Nebraska</li>
<li class="gameline"></li>
<li class="away">Indiana</li>
<li class="gameline"></li>
<li>Purdue</li>
<li class="gameline"></li>
<li class="away">Penn State</li>
<li class="gameline"></li>
<li>Illinois</li>
<li class="gameline"></li>
<li>BYE</li>
<li class="gameline"></li>
<li class="away">Wisconsin</li>
<li class="gameline"></li>
<li>Michigan</li>
</ul>
</div>
Use a inside your LI (for the date) and style the label instead of trying to put two LIs side-by-side and getting them to match. Set a width and float:left for the label.