Setting link text in front of overlapping images? - html

I have a footer for my website, in which there are links which images below them, and both separate divs containing these overlap. Where the images and links overlap, the links are not-clickable.
Extracting the relevant code and making a JSFiddle out of it might take a little time, so I'm posting images, and I hope someone can help me out based on these:
The footer_info div containing the links:
The footer_row_0 div containing the images:
For my scenario, the following links do not work:
Privacy Policy
Terms & Conditions
Site Map
Affiliates
Specials
Wish List
Newsletter
I already tried setting z-index: 10 for footer_info, but it didn't solve the problem. And if I set a negative z-index value for footer_row_0, the row disappears.
footer_info computed CSS:
background-color: rgb(255, 255, 255);
background-image: none;
background-position: 50% 0%;
background-repeat: no-repeat;
clear: both;
color: rgb(84, 84, 84);
display: block;
font-family: 'Open Sans', Arial, Helvetica, sans-serif;
font-size: 12px;
height: 149px;
line-height: 18px;
margin-bottom: -75px;
overflow-x: auto;
overflow-y: auto;
padding-bottom: 20px;
padding-left: 0px;
padding-right: 0px;
padding-top: 20px;
width: 980px;
z-index: auto;
footer_row_0 computed CSS:
color: rgb(224, 224, 224);
display: block;
font-family: 'Open Sans', Arial, Helvetica, sans-serif;
font-size: 12px;
height: 150px;
line-height: 18px;
position: relative;
width: 980px;
z-index: 0;
Can someone tell me how to solve this issue ?

In the footer_info use the z-index with the position:
Add this css in the footer_info div:
position: absolute;
z-index:999 !important;
z-index worked with the position property.

Alright guys, after spending 1-2 hours on this, I've managed to find the a solution. Firstly, thanks to #Broken Heart for his help, because my answer is partially based on his. Also, I'm not making my own answer to get points or something (don't really care about them), but I'm only doing so, so that other people also stuck on this issue can see what the solution was.
Okay, so I firstly applied this CSS for footer_info div:
#footer_info {
z-index: 1 !important;
position: relative;
}
For the small silhouette images, I had a CSS class silhouette too. So I added the following to silhouette CSS class:
.silhouette {
z-index: 2;
}
With these two modifications, I was able to get the links to click, and the silhouette images were also fully seen.

footer_info {
background-color: rgb(255, 255, 255);
background-image: none;
background-position: 50% 0%;
background-repeat: no-repeat;
clear: both;
color: rgb(84, 84, 84);
position: relative; /* or absolute */
display: block;
font-family: 'Open Sans', Arial, Helvetica, sans-serif;
font-size: 12px;
height: 149px;
line-height: 18px;
margin-bottom: -75px;
overflow-x: auto;
overflow-y: auto;
padding-bottom: 20px;
padding-left: 0px;
padding-right: 0px;
padding-top: 20px;
width: 980px;
z-index: 9999;
footer_row_0 {
color: rgb(224, 224, 224);
display: block;
font-family: 'Open Sans', Arial, Helvetica, sans-serif;
font-size: 12px;
height: 150px;
line-height: 18px;
position: relative;
width: 980px;
z-index: 1;
}

Related

z-index fail on safari - is it a transform issue?

I've tried solutions to similar questions but can't figure out for the life of me how to get the text to show on top of my poor custom buttons in Safari! They show perfectly in Chrome and Firefox... but that won't help iOs users of course.
Any suggestions for how to get these to display with the text on top of the intended background properly?
HTML:
Register
Register
CSS:
/* Hexagon Button Style */
.dark-button,
.light-button{
position: relative;
display: block;
background: transparent;
width: 280px;
height: 48px;
line-height: 46px;
text-align: center;
font-size: 16px;
letter-spacing: 1.8px;
text-decoration: none !important;
text-transform: uppercase;
font-weight:600;
margin: 15px auto;
font-family: Orbitron, Helvetica, sans-serif;
}
.dark-button:before,
.dark-button:after,
.light-button:before,
.light-button:after{
position: absolute;
content: '';
width: 280px;
left: 0px;
height: 24px;
z-index: -1;
}
.dark-button:before,
.light-button:before{
transform: perspective(8px) rotateX(3deg);
}
.dark-button:after,
.light-button:after{
top: 24px;
transform: perspective(8px) rotateX(-3deg);
}
/* Hex Button color styles */
.dark-button{
color: #ffffff;
}
.light-button{
color: #2c2a2b;
}
.dark-button.border:before,
.dark-button.border:after {
background: #2c2a2b;
}
.light-button.border:before,
.light-button.border:after {
background: #ededed;
}
/* Hex Button hover styles */
.dark-button.border:hover:before,
.dark-button.border:hover:after,
.light-button.border:hover:before,
.light-button.border:hover:after{
background: #BDBDBD;
}
.dark-button.border:hover,
.light-button:hover{
color: #ffffff;
}
>> Here's the CodePen link
It does appear, as hinted at in the question, that the various transforms are creating the problem. A non null transform can create a new stacking context - though exactly why the different browsers treat the aggregate of transforms differently I don't know.
However, I'd like to suggest a simpler way of creating the look - using clip-path on the anchor element. This obviates the need for pseudo elements and transforms so keeps things simple as far as stacking contexts are concerned.
This snippet only has the CSS required for the green button but the principle is the same for the other buttons. And you will want to play around with the % settings on the clip path to get exactly the pointy look that you want.
/* Hexagon Button Style */
/* Green Button Style */
.green-button {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 180px;
height: 48px;
line-height: 38px;
text-align: center;
font-size: 14px;
letter-spacing: 1.8px;
text-decoration: none !important;
text-transform: uppercase;
font-weight: 600 !important;
color: #ffffff;
margin: 15px auto;
font-family: Orbitron, Helvetica, sans-serif;
clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
background-color: #4f9f45;
}
.green-button:hover {
color: #ffffff;
}
Register
Note: clip-path is not supported on IE so users may have to put up with a rectangular button if IE is still in use.

Positioning issue in different browsers

I have a paragraph that appears really far left in I.E but its fine in firefox and chrome, I have been trying to fix this for a while now but i cant seem to get it to display correctly in all browsers
Codepen : https://codepen.io/mikegr/pen/ggXdVG
HTML
<p class = "info">Welcome to the programming part of my portfolio,<br>
here you can find a link to my github profile all of my programming work is.<br>
There is also a link to a bonus Snake game I created using JavaScript.<br>
the languages I am experienced in include html,css,javascript,php,mysql,java,python and c++</p>
CSS
.info{
clear:both;
position: fixed;
display:block;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
top: 70%;
transform: translateY(-50%);
text-align: center;
color: black;
font-family: 'Comfortaa', cursive;
padding: 10px;
font-style: italic;
font-weight: 700;
font-size: 16px;
text-align: center;
background-color: rgba(255,255,255, 1);
width: fit-content;
height: fit-content;
border: 2px solid black;
border-radius: 50px;
width: -moz-max-content;
width: -webkit-max-content;
display: table;
}
Looks like it's mainly because fit-content isn't supported in IE. http://caniuse.com/#feat=intrinsic-width.
.info {
clear: both;
position: fixed;
top: 0;
left: 50%;
margin: auto;
top: 70%;
transform: translate(-50%, -50%);
text-align: center;
color: black;
font-family: 'Comfortaa', cursive;
padding: 10px;
font-style: italic;
font-weight: 700;
font-size: 16px;
text-align: center;
background-color: rgba(255, 255, 255, 1);
border: 2px solid black;
border-radius: 50px;
}
<p class = "info">Welcome to the programming part of my portfolio,<br>
here you can find a link to my github profile all of my programming work is.<br>
There is also a link to a bonus Snake game I created using JavaScript.<br>
the languages I am experienced in include html,css,javascript,php,mysql,java,python and c++</p>
You should probably include a browser style reset CSS in your header before your main CSS script. These types of scripts reset browser CSS styles to be uniform among different ones.
I can recommend
Normalize.css but there are many out there!
Try the code given below. just copy and paste it as it is. I hope it will work fine.
<html>
<head>
<style>
.info{
position: relative;
display:block;
top: 500px;
margin: auto;
transform: translateY(-50%);
text-align: center;
color: black;
font-family: 'Comfortaa', cursive;
padding: 10px;
font-style: italic;
font-weight: 700;
font-size: 16px;
background-color: rgba(255,255,255, 1);
width: 50%;
width: fit-content;
height: fit-content;
border: 2px solid black;
border-radius: 50px;
width: -moz-max-content;
width: -webkit-max-content;
}
</style>
</head>
<body>
<p class = "info">Welcome to the programming part of my portfolio,<br>
here you can find a link to my github profile all of my programming work is.<br>
There is also a link to a bonus Snake game I created using JavaScript.<br>
the languages I am experienced in include html,css,javascript,php,mysql,java,python and c++
</p>
</body>
</html>

Top message box in CSS

I'd like to make a message-alert box in my web app. I created the main style but I have problems on small screen sizes.
Here's the image for the regular 1366x768 computer screen:
And here is for a typical mobile device:
Problems:
The X button has tagled with the message.
The main message wrapper has fixed and wasn't expand when the message came out of the wrapper.
How to fix the two above problems? Do I have to follow another path? I use position: fixed; property-value to keep my message on top.
Here are my HTMl and CSS code:
HTML:
<div class="top-msg">
<div class="top-msg-ico">
!
</div>
<div class="top-msg-inner">
<p>Only letters and nubers are allowed for email. See security for more info.</p>
</div>
<div class="top-msg-close" style=" cursor: pointer;">✕</div>
</div>
CSS:
.top-msg {
width: 100%;
height: 55px;
position: fixed;
background-color: rgba(42,45,50,0.6);
color: rgba(250,251,255,0.95);
font-family: "Lato", sans-serif;
font-size: 18px;
}
.top-msg-close {
float: right;
padding-top: 17px;
padding-right: 30px;
//border: 1px solid white;
//height: 100%;
width: 3%;
}
.top-msg-inner {
top: 15px;
position: absolute;
display: inline-block;
padding-left: 10px;
width: 80%;
//border: 1px solid white;
}
.top-msg-ico {
min-width: 65px;
height: 100%;
background-color: #fff;
display: inline-block;
background-color: rgba(0,0,0,0.7);
text-align: center;
font-size: 45px;
}
FIDDLE:
https://jsfiddle.net/4oLvyajo/
UPDATE -SOLUTION!-
After some help from LGSon answer I manage to finish all the design, so I accepts his answer but the hole solution is in the fiddle below.
FIDDLE:
https://jsfiddle.net/4oLvyajo/4/
Images:
Here is a start for you
.top-msg {
width: 100%;
position: fixed;
background-color: rgba(42,45,50,0.6);
color: rgba(250,251,255,0.95);
font-family: "Lato", sans-serif;
font-size: 18px;
}
.top-msg-close {
float: left;
box-sizing: border-box;
padding-top: 17px;
padding-right: 30px;
width: 45px;
}
.top-msg-inner a {
text-decoration: none;
color: RGBA(0, 0, 0, 0.6);
font-weight: bold;
}
.top-msg-inner a:hover {
color: RGBA(0, 0, 0, 0.5);
}
.top-msg-inner {
float: left;
box-sizing: border-box;
padding: 0 10px;
width: calc(100% - 110px);
}
.top-msg-ico {
float: left;
width: 65px;
height: 57px;
background-color: #fff;
background-color: rgba(0,0,0,0.7);
text-align: center;
font-size: 45px;
}
<div class="top-msg">
<div class="top-msg-ico">
!
</div>
<div class="top-msg-inner">
<p>Only letters and nubers are allowed for email. See security for more info.</p>
</div>
<div class="top-msg-close" style="cursor: pointer;">✕</div>
</div>
replace the width: 80% with margin-right: 40px, and you'll have to play around with the top: 15px as well (at -11 I had it looking right, but you can play around with that)
Here is the updated Fiddle
If you want everything scalable you'll need a completely different approach. First of all, if you place a right floating element under a block element it will float right, but underneath it. You'll need to define the floating close button element first.
Anyway, here's the updated Fiddle
It needs some minor tweaks in the padding and margins, but I think this is very close to what you're looking for

How would you add text over a full-screen background video in html?

i have a full screen image set in Html and want to add overlaying text.
my CSS looks like
.video {
position: fixed;
left: 0px;
top: 0px;
z-index: -100;
min-height: 100%;
min-width: 1040px;
width: 100%;
height: auto;
/*overflow: hidden;*/
}
.maintext {
color: #CCC;
z-index: 100;
font-size: 24px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-variant: small-caps;
font-weight: normal;
}
.rightcolumn {
float: left;
width: 50%;
}
.leftcolumn {
float: left;
width: 40%;
margin-left: 10%;
}
i want my left and right columns to show over the video that is playing in the background. I have the video on a full screen loop in my html code.
All in all i ideally would want something that looks like this
http://www.joe-san.com/
z-index needs to be on relative or absolute positioned elements:
.maintext {
position: relative;
color: #CCC;
z-index: 100;
font-size: 24px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-variant: small-caps;
font-weight: normal;
}
I think you're on the right path and you probably forgot the height on both columns.
Have a look at my code -> http://jsfiddle.net/uN7Db/
The trick is to make sure that both <html> and <body> elements stretch to 100% height. Once you're done with that you can style the video element in the background (like the one you wrote) and than you can continue writing your html like any other page.
Also, there is no need to declare height:auto in .video.

Move image behind the main content CSS

I have a problem with some css in my website
this is the main CSS source :
/* html selectors ---- */
html, body {
font-family: 'Arial Unicode MS';
margin: 0;
padding: 0;
background-repeat: repeat-x;
background-color: white;
direction: rtl;
font-size: 10.3pt;
}
h1, h2, h3, h4, h5, h6 {
margin: 0;
}
h1 {
font-size: 17pt;
text-decoration: underline;
top: 3px;
padding-bottom: 10px;
line-height: 25px;
}
h2 {
font-family: david;
font-size: 11pt;
color: #191970;
}
h3 {
font-size: 16pt;
color: white;
margin-left: 15px;
font-weight: bold;
margin-bottom: 20px;
padding-right: 30px;
padding-top: -55px;
font-family: 'Arial Unicode MS';
}
/*page -----------*/
#page {
width: 900px;
padding: 0px;
margin: 0 auto;
direction: rtl;
position: relative;
z-index: 100;
z-index: 5;
background-image: url("images/bgimage.png");
}
#leftshadow {
width: 100px;
height: 900px;
background-image: url("images/leftshadow.png");
position: absolute;
right: 840px;
z-index: none;
top: -25px;
}
#rightshadow {
width: 100px;
height: 900px;
background-image: url("images/rightshadow.png");
position: absolute;
right: -45px;
z-index: none;
top: -25px;
}
My question is how can I move the image-shdow back, behind the main content?
I tried a lot with z-index but I couldn't find a solution, can you help me solve thos problem pleas?
You forgot to use a position property in addition to the z-index property .. z-index will not work unless the element which has the z-index property applied to it is positioned using either:
position: relative;
position: absolute;
position: fixed;
Add one of those (relative preferably in your case) and it will work.
I recommend reworking your DOM structure to accomodate for this case, something like this:
<div class="content">
<div class="page"></div>
<div class="leftshadow shadow"></div>
<div class="rightshadow shadow"></div>
</div>
check out this fiddle of the how the new structure might work - http://jsfiddle.net/wHgm8/
You could also, if you wanted a nice clean shadow around the page, use css3 box-shadow, example here: http://jsfiddle.net/ASc7J/ though support is for newer browsers.
try this in your code:
box-shadow: 5px 0px 5px grey;
in above syntax, 5px is for left, 0px is for top and bottom and again 5px is for right. Play with the values untill you are comfortable. Also make sure you use hex values of color and is apt for a shadow.
You need both a position command, and "none" is not a valid z-index value. -1 works for me.
style="position:relative; z-index:-1;"