Text flickers on hover CSS - html

When hovering over the image to prompt the text to appear, the text and banner flutter once you put the mouse over it. How can this be prevented.
Any help would be appreciated thanks.
Here's the sample. http://jsfiddle.net/a3mcmbby/
Html:
<div id="container-content">
<div id="design-background">
</div>
<div id="content">
<div id="table-content">
<table align="center">
<tbody>
<tr>
<td colspan="2" valign="bottom" style="font-family:ralewayregular; color: rgb(37,37,37); font-size: 110%; line-height: 150%;">
</td>
<td><img src="/images/layout/layoutImg6.png" alt="" width="310" height="182">
</td>
</tr>
<tr>
<td>
<img src="/images/layout/layoutImg4.jpg" alt="" width="304" height="194">
<h3>EXAMPLE</h3>
</td>
<td rowspan="2">
<img src="/images/layout/layoutImg5.jpg" alt="" width="311" height="406">
<h3>EXAMPLE</h3>
</td>
<td>
<img src="/images/layout/layoutImg1.jpg" alt="" width="308" height="195">
<h3>EXAMPLE</h3>
</td>
</tr>
<tr>
<td>
<img src="/images/layout/layoutImg3.jpg" alt="" width="304" height="195">
<h3>EXAMPLE</h3>
</td>
<td>
<img src="/images/layout/layoutImg2.jpg" alt="" width="308" height="195">
<h3>EXAMPLE</h3>
</td>
</tr>
<tr>
<td colspan="3" style="text-align:center; font-family: Semibold; color: rgb(165,97,11); font-size:300%;">Serving St. Catharines and Niagara Region</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
CSS:
#container-content{
position:relative;
margin: 0 auto;
width:100%;
min-height:700px;
background-color:#FFF;
}
#design-background{
position:absolute;
height:350px;
top:50%;
left:0px;
right:0px;
margin-top: -145px;
background: url('../images/background-dec.jpg');
}
#content{
position:relative;
margin: 0 auto;
left:0;
right:0;
width:980px;
}
#table-content{
position:absolute;
margin-top:-30px;
}
#table-content table tr td{
position: relative;
padding:8px;
}
#table-content table tr td h3{
display:none;
}
#table-content table tr td a:hover + h3{
color:#FFF;
display:block;
position: absolute;
z-index:10;
margin: auto;
top:0;
bottom:0;
left:8px;
right:10px;
font-family: ralewayregular;
height:50px;
background-color: rgba(0,0,0,0.7);
text-align: center;
padding-top:25px;
font-size: 200%;
}
http://jsfiddle.net/a3mcmbby/

try this
#table-content table tr td:hover h3{ #do something ... }

In your HTML, nest h3 within a, then adjust your CSS accordingly.
As it is now, h3 is being placed over top of the a tag when the a tag is hovered over. This prevents hovering from working so the hover status is removed. Then, it picks up the cursor hovering again because it is no longer covered - continuing in an endless loop.

When you display the h3, it is intercepting the hover in the underlying element, so it is no longer hovered. Then h3 is not displayed, the underlying element is hovered again , and so on
set
#table-content table tr td h3 {
pointer-events: none;
}
to avoid it
fiddle

Related

How to turn a whole table cell into a link in HTML/CSS?

I've read a lot of questions about this problem, but none of those could solve it perfectly: the cell won't be clickable at its full height.
As shown in the picture, I made a headline for my webpage using the <table> tag and colored the clickable content into blue, while the whole table is orange.
The HTML code is:
<table class="visible" id="menu" align="center">
<tr>
<td><p>Home</p></td>
...
</tr>
</table>
And the CSS code is:
#menu a {
display: block;
text-decoration: none;
}
Unfortunately, as you can see, not the whole cell is blue, therefore not the whole cell is clickable. Could anyone tell me a perfect solution for this (possibly without using JavaScript)?
Try display: flex and justify-content: center instead of display: block.
a {
background: lightblue;
display: flex;
justify-content: center;
text-decoration: none;
}
<table align="center" border="1">
<tr>
<td><p>Home</p></td>
</tr>
</table>
Do not use <p/> (block-level) inside <a/> (inline-level).
a::after {
display:block;
content:" ";
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
background:yellow;
z-index:-1;
}
td
{
position:relative;
z-index:0;
}
delete styles for "a".
https://jsfiddle.net/1nrbL1mu/9/
This also works for IE:
a::after
{
display:block;
content:" ";
position:absolute;
top:0;
left:0;
width:100%;
height:300px; /* max possible */
background:yellow;
z-index:-1;
}
td
{
position:relative;
z-index:0;
overflow:hidden;
}
https://jsfiddle.net/1nrbL1mu/12/
Try puting it o new table of one column and one row
<table align="center" width="175" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <a href="#" title="Conoce más" style="text-decoration: none; color: #010000;" target="_blank">
<table align="center" width="175" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="border: 1px solid #f3b946; text-align: center; padding: 10px 35px 10px 35px; font-size: 18px;">CONOCE MÁS
</td>
</tr>
</table>
</a>
</td>
</tr>
</table>

html putting a div in between td tags on z axis

I have a table, but I would like to put my div tag in front of one too, but behind another, in the same table. I would like to put the div with the id "backDrop" behind the td with the id "td1", and the td with the id "menu", everything else should be behind the div
<table style="width:100%;border-collapse:collapse">
<tr style="z-index:1">
<td style="width:91.0vw;" id="header">
<h1>Tyler Silva E-Portfolio</h1>
</td>
<td onclick="openNav()"id="td1" style="background-color:#3953a5;z-index:initial;">
<img style="width:8vw;" id="logo" src="img/logo.png" onclick="openNav()"/>
</td>
<div id="backDrop" style="opacity:0" onclick="alert('hello')"></div>
</tr>
<tr>
<td>
<!--body-->
<h1 style="color:white">
hello world
</td>
<td id="nav" rowspan="2">
<div id="menu"><p>M<br />E<br />N<br />U<br /></p></div>
</td>
</tr>
<tr>
<td><!--footer--></td>
</tr>
</table>
and my css is
body
{
margin:0;
background-color:#55505c;
}
#header
{
height:8vw;
width:100%;
background-color:#77b6ea;
z-index:-1
}
h1
{
font-family:georgia;
font-size:3vw;
margin-top:1.5vw;
}
#logo
{
vertical-align:top;
padding:0;
}
td
{
padding:0
}
#nav
{
position:relative;
height:100vh;
background-color:#3953a5;
font-size:8vw;
z-index:100000;
}
#backDrop
{
position:fixed;
left:0;
top:0;
width:100vw;
height:100vh;
background-color:black;
z-index:initial;
opacity:0;
}
As #j08691 said placing div between a table row tag in invalid HTML. What you are after is something like this:
body
{
margin:0;
background-color:#55505c;
}
#header
{
height:8vw;
width:100%;
background-color:#77b6ea;
z-index:-1
}
h1
{
font-family:georgia;
font-size:3vw;
margin-top:1.5vw;
}
#logo
{
vertical-align:top;
padding:0;
}
td
{
padding:0
}
#nav
{
position:relative;
height:100vh;
background-color:#3953a5;
font-size:8vw;
z-index:100000;
}
#backDrop
{
position:fixed;
left:0;
top:0;
width:100vw;
height:100vh;
background-color:black;
z-index:99;
opacity:0;
border:1px solid #ffffff;
}
<div id="backDrop" style="opacity:0" onclick="alert('hello')"></div>
<table style="width:100%;border-collapse:collapse">
<tr>
<td style="width:91.0vw;" id="header">
<h1>Tyler Silva E-Portfolio</h1>
</td>
<td onclick="openNav()"id="td1" style="background-color:#3953a5;z-index:initial;">
<img style="width:8vw;" id="logo" src="img/logo.png" onclick="openNav()"/>
</td>
</tr>
<tr>
<td>
<!--body-->
<h1 style="color:white">
hello world
</h1>
</td>
<td id="nav" rowspan="2">
<div id="menu"><p>M<br />E<br />N<br />U<br /></p></div>
</td>
</tr>
<tr>
<td><!--footer--></td>
</tr>
</table>
The div has been placed placed above everything using z-index and position.
Is this what you were after?

CSS div container background clipped when zoomed or lower resolution

I'm currently working on a website for a friend of mine who runs a little hotel in Hungary. Here it is.
So far I´m quite pleased with the result. My problem however is, when viewing it on my laptop at 1440x900 or zooming in on my desktop PC the background of the "box" container gets clipped and won´t extend to the bottom of the page.
I fiddled around with all sorts of values but for the life of me, I can't find the error I made. Perhaps someone will spot it instantly.
Here's the html:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>www.kaiserapartman.hu</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
<link rel="icon" href="img/favicon.ico" type="image/x-icon">
</head>
<body class="pagebody"><img class="bg" src="img/bg.jpg"/>
<div id="main">
<div id="header">
<div id="flags"><table width="90" border="0" style="text-decoration:none">
<tr>
<td><img src="img/hu.jpg" width="28" height="18" alt=""/></td>
<td><img src="img/de.jpg" width="28" height="18" alt=""/></td>
<td><img src="img/uk.jpg" width="28" height="18" alt=""/></td>
<td><img src="img/ru.jpg" width="28" height="18" alt=""/></td>
</tr>
</table>
</div>
<div id="content">
<div id="buttons"><table width="90" border="0" style="text-decoration:none">
<tr>
<td><img src="img/taxi.png" width="90" height="90" alt=""/></td>
</tr>
<tr>
<td><img src="img/email.png" width="90" height="90" alt=""/></td>
</tr>
<tr>
<td><img src="img/facebook.png" width="90" height="90" alt=""/></td>
</tr>
<tr>
<td><img src="img/skype.png" width="90" height="90" alt=""/></td>
</tr>
<tr>
<td><img src="img/maps.png" width="90" height="90" alt=""/></td>
</tr>
<tr>
<td><img src="img/booking.png" width="90" height="90" alt=""/></td>
</tr>
</table>
</div>
<div id="logo"></div>
<div id="menu">
<div id="navbar" style="width:644px; float:left; clear:both;">
<li>Kezdőlap</li>
<li>Galéria</li>
<li>Árak</li>
<li>Szolgáltatások</li>
<li>Elérhetöség</li></div>
</div>
<div id="box">
<div id="images"><table border="0">
<tr>
<td><img src="img/00001.jpg" width="340" height="225" alt=""/></td>
</tr>
<tr>
<td><img src="img/00002.jpg" width="340" height="225" alt=""/></td>
</tr>
</table></div>
<div id="text"><table border="0">
<tr>
<td><h1>Üdvözöljük a hévízi Kaiser Apartman weboldalán!</h1>
<h2>Apartmanházunk csendes fekvésű helyen, Hévíz főutcájában, a hévízi termáltótól 200 méterre található.<p>Önellátó apartmanokat kínálunk, ingyenes Wi-Fi internettel és kábeltévével, valamint privát parkolási lehetőséggel.<p>A közelben reggelizők, éttermek, kávézók, üzletek találhatók.<p>Házunktól a buszmegálló 200 méterre, Keszthely (Balaton) 7 km-re, a Hévíz-Balaton Airport repülőtér 15 km-re helyezkedik el.<p>Taxi transzfer szolgáltatást biztosítunk távolabbról érkező vendégeink részére.
Kérjen árajánlatot!</h2>
</td>
</tr>
</table>
</div>
<div id="header"></div>
</div>
</div>
</div>
</div>
<div id="footer"></div>
</body>
</html>
And here´s the CSS:
#charset "utf-8";
/* CSS Document */
.pagebody {
margin:0px;
}
.bg {
width:100%;
height:100%;
position:fixed;
top:0;
left:0;
}
#main {
width:100%;
min-height:100vh;
position:absolute;
font:Verdana, sans-serif;
font-size:24px;
font-weight:bold;
z-index:1;
}
#header {
width:100%;
height:70px;
position:absolute;
background-image:url(img/header.jpg);
z-index:3;
}
#flags {
position:absolute;
z-index:3;
padding:0px;
}
#footer {
width:100%;
height:19px;
background-image:url(img/footer.jpg);
position:fixed;
z-index:6;
bottom:0px;
}
#content {
width:1100px;
min-height:100vh;
z-index:2;
position:relative;
left:50%;
margin-left:-500px;
}
#buttons {
width:100px;
height:500px;
left:1000px;
top:70px;
position:absolute;
z-index:5;
}
#box {
width:1000px;
min-height:100vh;
height:auto;
z-index:1;
position:absolute;
background:url(img/content.png);
}
#images {
top:275px;
position:absolute;
z-index:3;
left:10px;
padding-top:5px;
width:356px;
height:255px;
}
#text {
top:70px;
left:370px;
position:absolute;
z-index:3;
font-size:19px;
font:verdana;
font-weight:bold;
color:#4F1700;
width:620px;
}
#logo {
width:356px;
height:250px;
position:absolute;
z-index:4;
background-image:url(img/logo.png);
}
#menu {
width:644px;
height:70px;
background-color:gree;
position:absolute;
z-index:4;
left:356px;
}
#navbar {
width:644px;
height:70px;
font-size:16px;
font-family:Verdana, Geneva, sans-serif;
font-weight:bold;
z-index:5;
position:absolute;
line-height:70px;
color:#FFF;
}
#navbar li {
padding-left:21px;
padding-right:20px;
margin:0;
list-style:none;
float:left;
position:relative;
width:auto;
display:block;
text-align:center;
vertical-align:middle;
color:#4F1700;
text-decoration:none;
z-index:5;
}
#navbar li:hover {
background:url(img/hover.jpg);
z-index:5;
font-style:italic;
color:#4F1700;
}
What You Did
you played with zindexes of the divs and played it wrong..
Lets look at your code:
your div with id = "box" has a z-index 1 while its child div that contains all the text has its own z-index as z-index:3 in that case when the height of the text div will increase then the height of its parent div id = "box" wont increase with it... I have removed the z-index of your "text" div and gave it a margin-left:350px; and its perfect now ... Now you can open it at any resolution zoom it in or out ... It wont clip or break ... as a matter of fact try adding more text and the size of the div will increase ...
add this to your text div
style = "min-height: 30px; word-break: word-wrap; float: left; margin-left: 350px;"
and remove its z-index and absolute property ..
Always be careful when you are changing the z-indexes of the divs ...
You must fit the body to the viewport. you can do this by assigning the below css to body.
body {
position: fixed;
top: 0;
left: 0;
bottom: 0;
}
I know, that's not the best way to do this, but this is what i could come up with over a quick glance. Hope this helps
The problem is the width of #main is 100% which can be less than the width of #content when the window is sized down. #content has a left margin of -500px, so when the width is less than 1000px, it get moved off to the left.
Add min-width:1000px to #main and you'll establish scrolling at anything less than 1000px.

Adding an image to right pushes the table below to right

I have some HTML code. I have added two images: one alinged to the left and one to the right. Then it has two headings and an HTML table after that.
The problem is that I have use the following code to add the images to the document.
<img src="http://Path_To_Foler/Logo1.jpg" align="left" />
<img src="http://Path_To_Foler/Logo2.jpg" align="right" />
<p class="h1"><b>Private and Confidential</b> </p>
<p class="h1"><b>REPORT FOR Mr Person A BLA BLA</b> </p>
<table class="table" >
<tr>
<td class="CellHeader">Date </td>
<td class="CellHeader">Time</td>
</tr>
<tr>
<td class="cell"><AssessmentDateFrmMSPAPARR /></td>
<td class="cell"><CurrentRcFrmMSPAPARR /></td>
</tr>
</table>
CSS
<style>
.CellHeader{
width:50%;
text-align:left;
font-family: 'calibri';
font-size: 11pt;
color:#FFFFFF;
background-color:#151515;
border:1px solid black;
border-collapse:collapse;
}
.cell{
width:50%;
text-align:left;
font-family: 'calibri';
font-size: 11pt;
border:1px solid black;
border-collapse:collapse;
}
.table{
width:100%;
border:1px solid black;
border-collapse:collapse;
}
.h1{
page-break-before: always;
text-align: center;
font-family: 'calibri';
font-size: 12pt;
}
<style>
Issue
Everything was working fine as expected. The problem started when I added the second image. Adding second image causes the table to be aligned right as well.
And when I take out the align:"right" atribute from the image element, the table is where it is supposed to be but the second image is pushed to the right which is kind of understandable.
How can I fix this?
Try replacing align="left" by style="float:left" and align="right" by style="float:right"
Then, add clear: both in .table{} in your CSS.

How to make table column divisions centered between content?

How can I make the cell borders centered between the contents of the cells on either side?
I have a navigation bar I made with a table:
But I want the dividers to be centered like this:
How can I do this (without using javascript)?
JSFiddle
Html:
<table>
<tr>
<td>
<a href="something"><div>
something
</div></a>
</td>
<td>
<a href="something_else"><div>
Asdf
</div></a>
</td>
<td>
<a href="long_somthing"><div>
Extra Long Something
</div></a>
</td>
<td>
<a href="qwerty"><div>
qwerty
</div></a>
</td>
<td>
<a href="stuff"><div>
Things
</div></a>
</td>
</tr>
</table>
CSS:
table {
width:100%;
height:20px;
border-spacing:0px 0px;
background-color:#f6f6f6;
}
a {
color:#696969;
font-family:sans-serif;
text-decoration:none;
font-size:13pt;
outline:none;
}
div:hover {
color:#343434;
}
div:active, div:focus {
outline:none;
background-color:orange;
}
td {
border-left:2px groove rgba(147,147,147,0);
border-right:2px groove rgba(147,147,147,0);
text-align:center;
cursor:pointer;
}
td:hover {
border-left:2px groove rgba(147,147,147,.5);
border-right:2px groove rgba(147,147,147,.5);
color:#343434;
background-color:rgba(255,255,255,.5);
}
td:first-child {border-left:none;}
td:last-child {border-right:none;}
div {
width:100%;
height:100%;
padding:5px 0px;
}