I am currently struggling with a problem, that I can't find the reason.
Currently my anchor hover states are not displaying properly in Firefox and IE. The interesting this is that when I explore with firebug to see if the style is applied, it is there but the browser is not showing it. This is really driving me nuts!
The link is contained in a H1 tag. The same style is applied to the span username, but it is displayed perfectly.
Here is the code, I hope you can solve the mystery!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<tile> test</title>
</head>
<body>
<div id="content1" class="boxContainer">
<ul id="leggi-tab-content">
<li class="anteprimaG">
<div class="ombraCopertinaG ">
<img src="images/copertina-grande.gif" width="118" height="168" alt="Lorem ipsum dolor sit amet...">
<div class="fantascienzaG">
/div>
</div>
<div class="metadata">
<span class="star-rating05"> </span>
<span>1234567 letture</span>
</div>
<h1 class="truncationL">
<a class="link_primario" href="http://www.xyz.zz">Lorem ipsum
dolor sit amet, consectetur dipiscing elit. Maecenas facilisis
porttitor interdum. Phasellusnec arcu quam.</a>
</h1>
<span class="username truncationL">di <a class="link_secondario" href="#">username username username username username username username username username username username username username username username username </a></span>
<p class="truncationB">“Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Maecenas facilisis porttitor interdum. Phasellus
nec arcu quam. Donec id leo nibh. Sed vehicula dignissim libero,
a vehicula sapien sodales non. Nunc vel metus ante. Fusce pretium
convallis cursus. Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Maecenas facilisis porttitor interdum. Phasellus nec arcu
quam. Donec id leo nibh. Sed vehicula dignissim libero, a vehicula
sapien sodales non. Nunc vel metus ante. Fusce pretium convallis
cursusLorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
facilisis porttitor interdum. Phasellus nec arcu quam. Donec id leo
nibh. Sed vehicula dignissim libero, a vehicula sapien sodales non.
Nunc vel metus ante. Fusce pretium convallis cursusLorem ipsum dolor
sit amet, consectetur adipiscing elit. Maecenas facilisis porttitor
interdum. Phasellus nec arcu quam. Donec id leo nibh. Sed vehicula
dignissim libero, a vehicula sapien sodales non. Nunc vel metus ante.
Fusce pretium convallis cursus”</p>
</li>
</ul>
</div>
</body>
</html>
CSS
a.link_primario:link { color: #0d6083; text-decoration:none;}
a.link_primario:visited { color: #0d6083; text-decoration: none;}
a.link_primario:hover { color: #cf1d3c; text-decoration: underline; }
a.link_primario:active { color: #0d6083; text-decoration: none;}
.ombraCopertinaG {
background: url(../images/ombra-copertina-grande.png) left bottom no-repeat;
position: relative;
float: left;
display: inline-block;
margin-right: 10px;
}
.ombraCopertinaG img{ padding: 0 9px 5px 6px;}
.anteprimaG {margin-bottom: 20px;}
.anteprimaG h1 {
width: 53.684210526315789473684210526316%; /*510px/950px*/
margin-bottom: 0;
}
.anteprimaG p {
height: 111px;
width: 83.36842105263158%/*807px/950px*/
}
.username {
display: inline-block;
width: 53.684210526315789473684210526316%;/*510px/950px*/
margin: 9px 0 15px 0;
}
.metadata { float:right;}
.metadata span {
display:inline-block;
font-size: 0.75em ;/*12px/16px*/
vertical-align: middle;
margin-left:20px;
}
.metadata span:first-child{
margin-left: 50px;
}
The second link has a class="link_secondario" attribute, yet you only defined:
a.link_primario:link { color: #0d6083; text-decoration:none;}
Either change the second's links attribute to class="link_primario" (if it has the same properties, you do not need two classes) or define:
a.link_primario:link,a.link_secondario:link
{ color: #0d6083; text-decoration:none; }
Related
I am trying to make the following element (which is back to top link) appear just from a certain height.
As it for now it is always displayed and I would like to appear after some scrolling or even after a fixed size.
I would like to do it with CSS only if possible.
<div style='z-index: 9999; bottom: 3em; right: 3em; position: sticky; width: 32px; text-align: center'>
<a href='#top'>
<i class='fas fa-chevron-up fa-2x'/>
</a>
</div>
Thanks
You can approximate like below
.box {
position:absolute;
display:flex;
top:600px; /* the height you want here*/
left:0;
right:0;
bottom:0;
pointer-events:none;
}
.box a {
position: sticky;
z-index:999;
margin:auto 3em 3em auto;
bottom: 3em;
border-radius: 50%;
background: black;
color: #fff;
padding: 5px 7px;
font-size:16px;
pointer-events:initial;
}
body {
font-size:50px;
position:relative;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus consectetur ultrices arcu viverra malesuada. Donec pulvinar luctus lorem, eu consectetur felis interdum et. Nullam libero sem, aliquet eu porttitor ac, ullamcorper eget purus. Quisque tempus diam lorem, in aliquet arcu ullamcorper ut. Pellentesque non commodo tortor. Sed malesuada augue pellentesque diam aliquet, sit amet rhoncus diam mollis. Fusce justo leo, finibus eu turpis sit amet, ultrices condimentum mi. Duis at ornare eros, id venenatis neque. Aliquam blandit hendrerit tempus. Curabitur suscipit ipsum nec accumsan placerat.
<div class="box" >
<a href='#top'>
<i class='fas fa-chevron-up fa-2x'></i>
</a>
</div>
You can also consider a mask trick to hide the element when it's not needed (there is no scroll on the page)
.box {
position:absolute;
display:flex;
top:600px; /* the height you want here*/
left:0;
right:0;
bottom:0;
pointer-events:none;
-webkit-mask:linear-gradient(transparent calc(100vh - 600px),#fff 0);
}
.box a {
position: sticky;
z-index:999;
margin:auto 3em 3em auto;
bottom: 3em;
border-radius: 50%;
background: black;
color: #fff;
padding: 5px 7px;
font-size:16px;
pointer-events:initial;
}
body {
font-size:50px;
position:relative;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus consectetur ultrices arcu viverra malesuada. Donec pulvinar luctus lorem, eu consectetur felis interdum et. Nullam libero sem, aliquet eu porttitor ac, ullamcorper eget purus. Quisque tempus diam lorem, in aliquet arcu ullamcorper ut. Pellentesque non commodo tortor. Sed malesuada augue pellentesque diam aliquet, sit amet rhoncus diam mollis. Fusce justo leo, finibus eu turpis sit amet, ultrices condimentum mi. Duis at ornare eros, id venenatis neque. Aliquam blandit hendrerit tempus. Curabitur suscipit ipsum nec accumsan placerat.
<div class="box" >
<a href='#top'>
<i class='fas fa-chevron-up fa-2x'></i>
</a>
</div>
I'm sure there's a simple solution to this, but I've been beating my head up against it for an hour or two and not making much progress.
Basically, I've got a wrapper div (testwrap_outer) containing a secondary wrapper div (testwrap_inner) that holds together an image thumbnail div (test1), and a caption div (test2).
I need the caption div (test2) to scale height according to its content, the secondary wrapper (testwrap_inner) to contain that div and float next to any other secondary wrapper divs, and the main wrapper (testwrap_outer) to contain all of them.
I apologize for doing such a poor job explaining, so I've provided a picture to illustrate what I mean here. Here is a fiddle.
HTML
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi congue mi at aliquet blandit. Praesent tristique, dui sit amet iaculis mollis, nunc elit semper nisi, vitae finibus nulla dui in enim. In lacinia aliquam tempus. Nunc sollicitudin ac massa non porttitor. Maecenas quam urna, semper ut mauris id, lacinia consequat libero. Vivamus neque diam, vestibulum a est eget, aliquam tempus magna. Morbi sed tellus lobortis, condimentum mi id, finibus felis.</p>
<div class=testwrap_outer>
<div class=testwrap_inner>
<!-- THUMBNAIL IMAGE -->
<div class=test1>
<img src="http://i.imgur.com/5KObDyq.jpg">
</div>
<!-- THUMBNAIL CAPTION -->
<div class=test2><b>TEST2</b>
<br>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi congue mi at aliquet blandit. Praesent tristique, dui sit amet iaculis mollis, nunc elit semper nisi, vitae finibus nulla dui in enim.</div>
</div>
<div class=testwrap_inner>
<!-- THUMBNAIL IMAGE -->
<div class=test1>
<img src="http://i.imgur.com/5KObDyq.jpg">
</div>
<!-- THUMBNAIL CAPTION -->
<div class=test2><b>TEST2</b>
<br>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi congue mi at aliquet blandit. Praesent tristique, dui sit amet iaculis mollis, nunc elit semper nisi, vitae finibus nulla dui in enim.</div>
</div>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi congue mi at aliquet blandit. Praesent tristique, dui sit amet iaculis mollis, nunc elit semper nisi, vitae finibus nulla dui in enim. In lacinia aliquam tempus. Nunc sollicitudin ac massa non porttitor. Maecenas quam urna, semper ut mauris id, lacinia consequat libero. Vivamus neque diam, vestibulum a est eget, aliquam tempus magna. Morbi sed tellus lobortis, condimentum mi id, finibus felis.</p>
CSS
body {
background: #cccccc;
font-family: Arial, Helvetica, sans-serif;
min-width: 900px;
}
.testwrap_outer {
border: 1px solid red;
position: relative;
}
.testwrap_inner {
border: 1px solid blue;
float: left;
margin: 5px;
padding: 4px;
width: 296px;
}
.test1 {
border: 1px solid purple;
position: relative;
float: left;
opacity: 1.0;
width: 80px;
height: 80px;
overflow: hidden
}
.test1 img {
height: 100%;
}
.test1 img:hover {
opacity: 0.6;
}
.test2 {
border: 0px solid green;
position: relative;
float: left;
text-align: justify;
text-justify: inter-word;
padding: 6px;
width: 200px;
}
Any help is much appreciated.
Add inside testwrap_outer an empty div with clear:both style. This will tidy up the layout and make the outer div behave as a container supposed to be behave.
Updated fiddle:
http://jsfiddle.net/a3hz8dss/1/
just include overflow:hidden in your class testwrap_outer, also there is no need of position:relative in your code!!
CSS:
.testwrap_outer{
border: 1px solid red;
overflow:hidden;
}
Fiddle Demo
I would like to know if for the demo index page of this site url, I can prevent the text from overflowing or let say use optional scrolling bar when the text goes over the bottom of the blue box? I would like the layout to be similar to this 'production' site (with server stats visits).
Can I do this using html 5? Should I include div so to limit text overflow under a certain screen resolution. Please find the html and style sheet code used (thanks for the author of this design and also Aayushi Jain who has help me with a few style sheet adjustments from another question here on this site).
style sheet
html {
overflow-y: scroll; }
div#wrapper {
width:90%;
margin: 10px auto;
position: relative;}
header#site {
height:80px;
padding:10px;
background-color:#0033FF;
margin:10px 0px;
text-align:center; }
footer {
font-size:0.8em;
clear:both;}
footer .col {
width:30%;
margin:1% 1.1%;
padding:2px;
height:100px;
background-color:#F63;
float:left; }
nav {
background-color:#0033FF;
position: absolute;
left: 0;
bottom: 0;
top: 110px;
width: 29%; }
nav ul {
list-style:none;}
nav ul li a {
display: block;
background-color:#CCC;
margin-right: 20px;
width: 110px;
line-height:1.5em;
text-align: center;
text-decoration: none;
color: #000; }
nav ul li a:hover {
color: #fff;
background-color:#39C; }
article {
background-color:#0066FF;
float:right;
width:69%;
margin-right:10px;
height:50%;
overflow-y:scroll;
}
article header {
background-color:#F90;
padding:15px; }
section#abstract {
font-size:1.09em;
font-style:italic;
margin:10px 0px;
text-align:justify;
padding:5px 80px; }
section#main {
font-size:1em;
padding:20px;
text-align:justify;
float: left;
margin: 0;
padding: 0;
display: inline; }
.ads {
height:50%;
width:30%;
background-color:#0033FF;
margin-bottom:1%;
float:left;}
.ads p:first-child {
padding:15px;
font-size:2em;}
.ads p:last-child {
padding-left:15px;
font-size:1em;color:#CCC;}
the html file
<!DOCTYPE html>
<!-- saved from url=(0064)http://toytic.com/class/examples/e808_html5_Header2NavAside.html -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Web site</title>
<link href="style.css" rel="stylesheet" />
<style>
</style>
<!-- Tell IE we are using html5 + CSS -->
<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div id="wrapper">
<header id="site">
<h1>WEBSITE</h1>
</header>
<article>
<header>
<h2>This is the article header</h2>
<time datetime="25-11-2010" pubdate="">25th November 2010</time>
</header>
<section id="abstract">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam et orci sed neque tincidunt dictum nec at lacus. Fusce feugiat sagittis ligula ac aliquam. Integer ut sodales justo. Etiam ultrices cursus iaculis. Suspendisse bibendum. </p>
</section>
<section id="main">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ac velit mauris. Nulla cursus pretium dapibus. Fusce at faucibus mi. Etiam ac nisi condimentum quam vulputate euismod. Nunc viverra consectetur tempor. Praesent rutrum diam in leo lacinia sit amet volutpat leo tempus. Donec sodales, velit et viverra imperdiet, velit leo placerat libero, fringilla scelerisque justo sapien sit amet sapien. Donec blandit tellus at mi hendrerit hendrerit. Sed suscipit sagittis sodales. Etiam sagittis, tortor quis sagittis laoreet, erat nibh mollis sem, ut tristique felis augue non metus. </p>
<p>Etiam in gravida mi. Maecenas placerat, justo vel gravida egestas, odio sem dictum justo, eget volutpat massa augue in augue. Sed tempus sem a nulla eleifend aliquet aliquet diam pharetra. Proin sit amet imperdiet est. Cras vitae felis in nulla tristique porttitor ut sit amet neque. Quisque sed nisi quam. Aliquam erat volutpat. Nullam dignissim augue odio. Nam sit amet ipsum arcu, id rutrum felis. Phasellus velit mauris, dictum eget tincidunt eget, condimentum eget risus. Proin nibh nulla, sagittis et feugiat in, luctus quis velit. Aenean lobortis mi ut odio accumsan adipiscing. Nulla quis ipsum magna. Suspendisse auctor mauris eu mi cursus ultrices. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas gravida vulputate leo, consectetur porta sem euismod nec. Donec et dolor lectus, vel cursus massa. Morbi eu dictum arcu. Fusce luctus porttitor neque, sed eleifend orci tristique convallis. </p>
</section>
</article>
<nav>
<ul>
<li>About</li>
<li>Service</li>
<li>Contact</li>
</ul>
</nav>
<footer>
<div class="col">
<h4>Contact</h4>
<adress>
<p>Janet Griffith from Public Relations</p>
<p>Jil Sanders, webmaster</p>
</adress></div>
<div class="col">
<h4>Sites of interest</h4>
<aside>
<p>Site A</p>
<p>Another one</p>
</aside>
</div>
<div class="col">
<h4>Legal stuff</h4>
<p>Copyright</p>
<p>Terms of Service</p>
</div>
</footer>
</div>
</body></html>
thanks
Pascal
If you don't want to see the scroll bar then use overflow: hidden or overflow: auto.
Now if you want the header part to be static then put your section main and abstract in a div and make its height: 500px (or something you want) but make it fix and then use overflow: hidden in the newly mad div if you don't want to show the overflow part or use overflow: auto if you want to show the overflow part but not the scroll bar.
I want to implement the bullet style for each unordered list.I have the sprite image for that.And I implemented it.I took the example form the below link.
http://www.cssbakery.com/2012/08/css-list-with-icon-sprites.html
It works fine except in IE7.The same tutorial I want to run in IE7 also.How can I achieve it?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Sprites for Bullets</title>
<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->
<style>
div
{
width:30%;
float:left;
}
.bullet {
list-style-type: none;
margin:0; padding:0;
}
.bullet li
{
// padding-top: 5px;
padding-left: 20px;
//margin-bottom: 15px;
//line-height:1.5em;
//position: relative;
}
.magento li:before
{
display: inline-block;
position: absolute;
margin: 9px 0 0 -20px;
min-height: 9px;
background: url(images/bulletsprite.png) no-repeat -116px 0px;
content:"";
// vertical-align: middle;
width: 9px;
height: 9px;
float:left;
}
</style>
</head>
<body>
<div>
<p>Magenta</p>
<ul class="magento bullet">
<li>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nulla sapien, varius id dignissim sit amet, luctus elementum nulla. Mauris hendrerit tincidunt nunc condimentum accumsan. Donec semper hendrerit ligula non blandit. Nullam tellus lacus, dictum quis sodales id, consectetur posuere nunc. Maecenas massa nibh, sagittis quis hendrerit ornare, interdum sit amet tellus. Proin lectus neque, posuere at interdum vitae, eleifend id dui. Mauris eget eros magna, sed gravida quam.
</li>
<li>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nulla sapien, varius id dignissim sit amet, luctus elementum nulla. Mauris hendrerit tincidunt nunc condimentum accumsan. Donec semper hendrerit ligula non blandit. Nullam tellus lacus, dictum quis sodales id, consectetur posuere nunc. Maecenas massa nibh, sagittis quis hendrerit ornare, interdum sit amet tellus. Proin lectus neque, posuere at interdum vitae, eleifend id dui. Mauris eget eros magna, sed gravida quam.
</li>
</ul>
</div>
</body>
</html>
IE7 does not support the :before pseudo selector, so the majority of those styles will not work.
See the :before/:after browser support chart.
You can use IE8.js to make :before work in IE7.
Before test page: http://ie7-js.googlecode.com/svn/test/before.html
I'm building a page layout with 3 divs: a header and a footer with fixed heights in pixels, and a content div in the middle of the page that should fill the remaining screen height. Furthermore, I want to be able to set height to 100% in the inner content divs, because one of them will host a kind of drawing area that need to fill the remaining screen height. So, it's especially important that inner divs do not leak under the header or footer. So far, I achieved a 100% valid CSS solution that work in all majors browsers except Internet Explorer 6 & 7.
Is there anything I can do to fix my layout for IE6 & 7? Or, do you see another way to do what I want?
Here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The #content div fill the remaining height and appears to have a height</title>
<style TYPE="text/css">
<!--
* {
margin: 0;
padding: 0;
}
html, body,
#container{
height: 100%;
}
#container{
position: relative;
}
#header,
#footer{
height: 60px;
line-height: 60px;
background: #ccc;
text-align: center;
width : 100%;
position: absolute;
}
#header{
top: 0;
}
#footer{
bottom: 0;
}
#content{
position: absolute;
top:60px;
bottom: 60px;
width : 100%;
overflow: auto;
border-top: 1px solid #888;
border-bottom: 1px solid #888;
}
#inner-content{
overflow: auto;
background-color: #FC0;
height: 100%;
}
p{
margin-bottom: 10px;
}
-->
</style>
</head>
<body>
<div id="container">
<div id="header">
<h1>Header</h1>
</div>
<div id="content">
<div id='inner-content'>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur quis turpis vel
quam dictum hendrerit eu non elit. Donec ultricies ullamcorper libero a molestie.
Donec auctor nulla vitae tortor ullamcorper posuere. Etiam fringilla tristique blandit.
</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur quis turpis vel
quam dictum hendrerit eu non elit. Donec ultricies ullamcorper libero a molestie.
Donec auctor nulla vitae tortor ullamcorper posuere. Etiam fringilla tristique blandit.
</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur quis turpis vel
quam dictum hendrerit eu non elit. Donec ultricies ullamcorper libero a molestie.
Donec auctor nulla vitae tortor ullamcorper posuere. Etiam fringilla tristique blandit.
</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur quis turpis vel
quam dictum hendrerit eu non elit. Donec ultricies ullamcorper libero a molestie.
Donec auctor nulla vitae tortor ullamcorper posuere. Etiam fringilla tristique blandit.
</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur quis turpis vel
quam dictum hendrerit eu non elit. Donec ultricies ullamcorper libero a molestie.
Donec auctor nulla vitae tortor ullamcorper posuere. Etiam fringilla tristique blandit.
</p>
</div>
</div>
<div id="footer">
<h1>Footer</h1>
</div>
</div>
</body>
</html>
Thanks in advance for your help.
Live example here.
I ended up using Javascript to achieve the same thing