FF rendering position relative different than all other browsers - html

My website, http://dev.markzanghi.com, is rendering incorrectly in firefox and i don't know why.
Every other browser, including IE renders it correctly. The link above will display the mistake. Basically, i need two parts to my header for an animation. Below is my CSS
/*
TOP BAR
*/
.topbar {
height: 75px;
background: url('../img/headerBGtop.png') repeat-x;
}
.bottomTopBar {
background: url('../img/headerBGbottom.png') repeat-x;
height: 6px;
position: relative;
top: 64px;
}
.topbar .headerWrapper {
max-width: 924px;
margin: 0 auto;
padding: 0 5px;
}
.bottomHeader {
position: relative;
top: -11px;
left: 0px;
z-index: 1;
}
.headerArrowImg {
width: 924px;
overflow: hidden;
}
.bottomFiller {
position: relative;
top: -24px;
background: url(/img/headerBGbottom);
height: 11px;
}
#leftBottomHeader {
}
#rightBottomHeader {
top: -35px;
}
.logo {
float: left;
margin-top: 13px;
}
.logo img {
height: 55px;
}
.topbarLinks {
float: right;
text-decoration: none;
position: relative;
top: 44px;
z-index: 10;
}
.topbarLinks a{
color: white;
margin-left:25px;
padding: 10px 0px;
}
.topbar .headerArrowImg img {
max-width: none;
position: relative;
left: -200px;
}
And the HTML:
<header>
<div class="topbar navbar-fixed-top" >
<div class="headerWrapper">
<div class="logo">
<img src="img/homeLogo.png" />
</div>
<div class="topbarLinks">
<a id="workLink" href="#"><img src="img/workLink.png" /></a>
<a id="aboutLink" href="#/about"><img src="img/aboutLink.png" /></a>
<a id="contactLink" href="#/contact"><img src="img/contactLink.png" /></a>
</div>
<div id="bottomHeaderWrap" class="bottomHeader">
<div class="headerArrowImg">
<div id="arrowImgWrapper">
<img src="/img/headerArrowImg.png" />
</div>
</div>
</div>
</div>
<div id="leftBottomHeader" class="bottomFiller">
</div>
<div id="rightBottomHeader" class="bottomFiller">
</div>
</div>
</header>
If anyone has any idea why this is not working, please let me know!
Thanks in advance.

I had the same issue with a menu animation a while back.
The "problem" is that Firefox requires an explicit declaration of both X & Y coordinates when one is declared. On several items you have declared a top (Y), but you have not declared a left or right (X).
Add a left:0 or something and you should be fine. Or, since they are position:relative, you could just convert top to margin-top.

Related

Position <a> tag but don't include overflow (position: absolute) image

So, hard to explain, but I'm trying to position a link over the entire abstract background, but not include the overflow of the other image placed on top. I've tried about everything I could think of, and couldn't come up with a solution. Wrap all the images in the tag, and I couldn't figure out how to size it to only include the abstract background image border. Only wrap the abstract background and text, can't get it to include the overlaid image (within the border of the abstract background of course).
Am I trying to accomplish the impossible?
img {
max-width: 100%;
}
.cat-item-container {
display: flex;
flex-wrap: wrap;
padding-top: 50px;
}
.category-heading {
width: 100%;
text-align: center;
}
.cat-item {
width: 44%;
margin: 5% 3%;
position: relative;
}
.cat-background-img {
position: relative;
border-radius: 20px;
}
.cat-background-orange {
filter: hue-rotate(74deg);
}
.cat-item-img {
position: absolute;
z-index: 999;
bottom: 50%;
width: 70%;
}
.cat-title-container {
position: absolute;
z-index: 9999;
bottom: 20%;
left: 5%;
}
.cat-title {
color: white;
font-weight: 600;
font-size: 4vw;
text-shadow: 0px 0px 7px #3e3e3e;
margin: 0;
}
.cat-item a {
display: block;
}
#media screen and (min-width: 1200px) {
.cat-title {
font-size: 48px;
}
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<div class="shop-by-category container">
<div class="category-heading">
Shop by Category
</div>
<div class="cat-item-container">
<div class="cat-item">
<a href="/category/water-slides/">
<img class="cat-item-img water-slide" src="//files.sysers.com/cp/upload/vzcpr/editor/full/blue-marble-water-slide.png">
<img class="cat-background-img cat-background-orange" src="//files.sysers.com/cp/upload/vzcpr/editor/full/cat-background-orange.jpg">
<div class="cat-title-container">
<p class="cat-title">Water Slides</p>
</div>
</a>
</div>
<div class="cat-item">
<img class="cat-item-img combo-house" src="//files.sysers.com/cp/upload/vzcpr/editor/full/Tiki-bounce-combo.png">
<a href="/category/bounce-and-slide-combos/">
<img class="cat-background-img" src="//files.sysers.com/cp/upload/vzcpr/editor/full/cat-background-pink.jpg">
<div class="cat-title-container">
<p class="cat-title">Combo Houses</p>
</div>
</a>
</div>
<div class="cat-item">
<img class="cat-item-img bounce-house" src="//files.sysers.com/cp/upload/vzcpr/editor/full/castle-no-background.png">
<img class="cat-background-img " src="//files.sysers.com/cp/upload/vzcpr/editor/full/cat-background-blue.jpg">
<div class="cat-title-container">
<p class="cat-title">Bounce Houses</p>
</div>
</div>
</div>
</div>
https://jsfiddle.net/61Lh3cyx/
To stop the 'top' of the imgs being part of the linking you could move the anchor element so it is not the parent of either img or the associated text. Move it to just below the text element and make it position absolute, the same height and width as the item and background color transparent.
That way the sticking out bit of the image does not get included, but the whole of the rest of the item is covered so you don't get a gap where the img is.
img {
max-width: 100%;
}
.cat-item-container {
display: flex;
flex-wrap: wrap;
padding-top: 50px;
}
.category-heading {
width: 100%;
text-align: center;
}
.cat-item {
width: 44%;
margin: 5% 3%;
position: relative;
}
.cat-background-img {
position: relative;
border-radius: 20px;
}
.cat-background-orange {
filter: hue-rotate(74deg);
}
.cat-item a {
position: absolute;
background-color: transparent;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 99999;
}
.cat-item-img {
position: absolute;
z-index: 999;
bottom: 50%;
width: 70%;
}
.cat-title-container {
position: absolute;
z-index: 9999;
bottom: 20%;
left: 5%;
}
.cat-title {
color: white;
font-weight: 600;
font-size: 4vw;
text-shadow: 0px 0px 7px #3e3e3e;
margin: 0;
}
.cat-item a {
display: block;
}
#media screen and (min-width: 1200px) {
.cat-title {
font-size: 48px;
}
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.2/dist/css/bootstrap.min.css" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<div class="shop-by-category container">
<div class="category-heading">
Shop by Category
</div>
<div class="cat-item-container">
<div class="cat-item">
<img class="cat-item-img water-slide" src="//files.sysers.com/cp/upload/vzcpr/editor/full/blue-marble-water-slide.png">
<img class="cat-background-img cat-background-orange" src="//files.sysers.com/cp/upload/vzcpr/editor/full/cat-background-orange.jpg">
<div class="cat-title-container">
<p class="cat-title">Water Slides</p>
</div>
</div>
<div class="cat-item">
<img class="cat-item-img combo-house" src="//files.sysers.com/cp/upload/vzcpr/editor/full/Tiki-bounce-combo.png">
<img class="cat-background-img" src="//files.sysers.com/cp/upload/vzcpr/editor/full/cat-background-pink.jpg">
<div class="cat-title-container">
<p class="cat-title">Combo Houses</p>
</div>
<a href="/category/bounce-and-slide-combos/">
</a>
</div>
<div class="cat-item">
<img class="cat-item-img bounce-house" src="//files.sysers.com/cp/upload/vzcpr/editor/full/castle-no-background.png">
<img class="cat-background-img " src="//files.sysers.com/cp/upload/vzcpr/editor/full/cat-background-blue.jpg">
<div class="cat-title-container">
<p class="cat-title">Bounce Houses</p>
</div>
</div>
</div>
</div>

How do I align an image to the top margin of page

I'm finishing a webpage using wordpress as a CMS. and my client asked me to put an image/button at the very top of the page.aligned to the main navigation menu.
That's OK, I did it but what happened is this:
when I use different screen resolution, the buttons do not stay aligned with the very top of the page
I've tried to use "Position: fixed", but with that, the buttons move with the page and I want them to stay at the top of the page and don't scroll along with the page.
How can I do that? Can someone help me? Thanks!!!
.buttons {
position: absolute;
left: 85%;
z-index:905;
margin-top:0
}
.buttonLang {
position: relative;
z-index: 910;
}
.buttonZone {
position: relative;
z-index: 915;
top: -107px;
left: 100px;
}
.selectLang {
display: none;
position: absolute;
left: 0;
bottom: 5px;
right: 0;
background-color: rgba(0,0,0,1);
}
#buttonLang:hover img {
opacity: 1;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: /*#2893CC;
*/#FFFFFF;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,1);
padding: 12px 16px;
z-index: 1;
font-family: Calibri;
}
.dropdown:hover .dropdown-content {
display: block;
line-height: 200%;
}
</head>
<body>
<body bgcolor="#E1E1E1">
<div class="buttons">
<div class="buttonLang">
<div class="dropdown">
<img src="http://www.jourdan.org.br/wp-content/uploads/button-lang.png" alt="" title=""/>
<div class="dropdown-content">
<img src="http://localhost/wp-content/uploads/2016/10/flag-bra.png" width="30"alt="" title=""/> Português</br>
<img src="http://localhost/wp-content/uploads/2016/10/flag-esp.png" width="30"alt="" title=""/> Español</br>
<img src="http://localhost/wp-content/uploads/2016/10/flag-usa.png" width="30"alt="" title=""/> English
</div>
</div>
</div>
<div class="buttonZone">
<img src="http://www.jourdan.org.br/wp-content/uploads/button-sgvzone.png" alt="" title=""/>
</div>
<!-- begin snippet: js hide: false console: true babel: false -->
Add this to your CSS:
.post > .post-content > .wpb_row > .wpb_column {
position: static;
}
.buttons {
position: absolute;
right: 10%;
top: 0;
z-index: 905;
margin-top: 0px;
}
However I don't understand why you don't move the buttons HTML into the header. When you resize the browser, the buttons overlap the navigation and this can't be corrected with just a few lines of CSS.
Try position: absolute; instead. Also top: 0px; should keep it stuck there.
body{position :relative;} .button{position:absolute; top:0px; left:10px;}
Align them to the right instead of left :)
.buttons {
position: absolute;
right: 10%; /* for example, adjust how you need */
z-index:905;
margin-top:0
}

How to stop two divs from pushing each other on window resize

So I was wondering how can I make the box stops exactly before it go through the text. The box is just floating under the text, I want to make it stop floating before it hits.
Normal Size
Window resized
HTML:
<div class="program"></div>
<span class="but">
<h2 class="zaglavie">CSGOFREEITEMS <span class="beta">0.5.1</span></h2>
<p class="opisanie"><b>Ultimate platform</b>. The easiest way to have fancy inventory. Get the item you want just in <b>seconds</b>.</p>
<div class="buttons">
<a class="button1" href="#above"></a>
<a class="button2" href="#above"></a>
<span style="float: right; color: white; margin-right: 2px; margin-top: 1px; font-size: 10.5px;">for only <b>$4.99</b>/month</span>
</div>
</span>
<br>
CSS:
.but
{
position: absolute;
top: 90px;
font-family: Verdana;
display: block;
}
.zaglavie
{
font-family: 'Open Sans', sans-serif;
color: #e5e5e5;
font-size: 31px;
text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.39);
position: relative;
left: 70px;
top: 100px;
font-weight: 700;
}
.opisanie
{
font-family: 'Open Sans', sans-serif;
color: #fefefe;
text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.39);
font-size: 16px;
left: 70px;
top: 90px;
position: relative;
width: 400px;
}
.buttons
{
margin-left: 70px;
margin-top: 120px;
width: 375px;
height: 57px;
}
.button1
{
display:block;
width: 227px;
height: 57px;
background-image: url(images/button1.png);
background-repeat: no-repeat;
float: left;
}
.button2
{
display:block;
width: 136px;
height: 57px;
background-image: url(images/button2.png);
margin-left: 240px;
}
.program
{
display:block;
width: 665px;
height: 745px;
background-image: url(images/sosi2.png);
background-repeat: no-repeat;
right: 50px;
position: relative;
float: right;
}
Weave: http://kodeweave.sourceforge.net/editor/#4fc7d9522497eba555377ed94d364ee3
CSS Media Queries are a good solution for your problem.
I made a simple snippet here to show you how they work. You can utilize them with your site to fix the problem.
What I decided to do here is use display: table; and table-cell to center your elements.
I then used media queries to change the element from display: table; to display: block;
In addition I change your program background image to an image element as it's easier to style and handle upon page resize.
I converted your images to Base64 aka DataURL (because I'm on a tablet and it's easier to test without extra http requests.
Here's a very simple example of how you can solve your problem with media queries
You can view this weave for a more extensive solution (ex display: table; and table-cell).
.left, .right {
position: absolute;
top: 0;
bottom: 0;
padding: 1em;
}
.left {
left: 0;
right: 50%;
background: #93e9ff;
}
.right {
right: 0;
left: 50%;
background: #47ffaf;
}
#media all and (min-height: 300px) {
.left, .right {
position: absolute;
left: 0;
right: 0;
}
.left {
top: 0;
bottom: 50%;
}
.right {
bottom: 0;
top: 50%;
}
}
<div class="left">left content</div>
<div class="right">right content</div>
You can use Bootstrap and you will have a nice responsive design for your page.
This is your code with bootstrap, without css and using the images in the HTML section:
<!Doctype html>
<html>
<head>
<meta charset ="utf-8">
<!--Bootstrap-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
</head>
<body>
<div class="container-fluid">
<div class="row">
<!--you can change that numbers to adapt your page to another devices like tablets-->
<!--if you see, the numbers are a proportion of 12, in this case, 5:7 (check the last div)-->
<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
<span class="but">
<h2 class="zaglavie">CSGOFREEITEMS <span class="beta">0.5.1</span></h2>
<p class="opisanie"><b>Ultimate platform</b>. The easiest way to have fancy inventory. Get the item you want just in <b>seconds</b>.</p>
<div class="buttons">
<a class="button1" href="#above"><img src="images/button1.png"></a>
<a class="button2" href="#above"><img src="images/button2.png"></a>
<span style="float: right; color: white; margin-right: 2px; margin-top: 1px; font-size: 10.5px;">for only <b>$4.99</b>/month</span>
</div>
</span>
</div>
<!--if you see, the numbers are a proportion of 12, in this case, 5:7-->
<div class="col-xs-7 col-sm-7 col-md-7 col-lg-7">
<img class="img-responsive" src="images/sosi2.png">
</div>
</div> <!-- end row -->
</div> <!-- end container-fluid -->
</body>
You can implement your css from here and you will see that will be more easy and solid.
See http://getbootstrap.com/components/
Or https://www.youtube.com/watch?v=3cYWiU_HsgM (a nice tutorial of Bootstrap 3)
Hope this helps.

corner ribbon for resposive image

I am trying to make a corner ribbon to sit over an image, on a responsive design site. I have set up a fiddle page with the code I've got so far. As you can see there, it seems to insert a top margin (the corner of the ribbon is not disappearing) and the overflow is not hidden. Any ideas why?
JSfiddle
.ribbon-holder {
overflow: hidden;
}
.ribbon {
position: relative;
background: yellow;
color: black;
transform: rotate(-45deg);
text-align: center;
top: 52px;
left: -32px;
width: 145px;
}
<div class="ribbon-holder">
<div class="ribbon ribbon-holder">Free Shipping!</div>
<a href="http://www.somesite.com">
<img src="http://www.adventurouskate.com/wp-content/uploads/2016/01/planes-black-shower-curtain.jpg" alt="Shower Curtin" />
</a>
</div>
use position:relative in the parent (.ribbon-holder) and absolute in the child (.ribbon)
.ribbon-holder {
overflow: hidden;
position: relative
}
.ribbon {
position: absolute;
background: yellow;
color: black;
transform: rotate(-45deg);
text-align: center;
top: 32px;
left: -32px;
width: 145px;
}
<div class="ribbon-holder">
<div class="ribbon ribbon-holder">Free Shipping!</div>
<a href="http://www.somesite.com">
<img src="http://www.adventurouskate.com/wp-content/uploads/2016/01/planes-black-shower-curtain.jpg" alt="Shower Curtin" />
</a>
</div>
How about this:
html:
<div class="ribbon-holder" >
<a href="http://www.somesite.com" ><img itemprop="image" class="imageSize" src="http://www.adventurouskate.com/wp-content/uploads/2016/01/planes-black-shower-curtain.jpg" alt="Shower Curtin" /></a>
</div>
<div class="ribbon ribbon-holder">
Free Shipping!
</div>
css:
.ribbon-holder{
overflow: hidden;
}
.ribbon{
position: absolute;
background: yellow;
color: black;
transform: rotate(-45deg);
text-align: center;
top: 30px;
left: -32px;
width:145px;
}
https://jsfiddle.net/L4kojc4k/2/
Here are the changes i made :
.ribbon-holder{
overflow: hidden;
position: relative;// added by DamienBannerot
}
.ribbon{
position: absolute;// added by DamienBannerot
background: yellow;
color: black;
transform: rotate(-45deg);
text-align: center;
top: 32px;// added by DamienBannerot
left: -32px;// added by DamienBannerot
width:145px;
}
fiddle here : https://jsfiddle.net/L4kojc4k/4/

How to override the height of parent node using CSS?

I'm writing an online chatting widget and I plan to design it as Facebook's.
In my page, a bar is fixed on the bottom, and every chat rooms are contained in that bar.
While the bar's height is fixed, the chat rooms cannot extend its height outside the bar.
Is there any method to achieve this? I have used z-index, !important, and overflow, but all failed.
CSS:
#SNbar {
background-color: rgba(203, 203, 203, 0.80);
position: fixed;
bottom: 0;
width: 100%;
height: 25px;
z-index: 900;
overflow: visible;
}
#chatSessions {
position: relative;
bottom: 0;
float:right;
z-index: 901;
}
.chatSession {
/*
position: fixed;
bottom: 0;
*/
padding: 0 10px 0 0;
width: 260px;
float: right;
z-index: 999;
}
.CStitle {
height: 25px;
background-color:#3B5998;
cursor: pointer;
}
.CStitle .titleText{
text-decoration: none;
font-weight:bold;
color: #FFFFFF;
text-decoration: none;
line-height:2em;
}
.CSbody {
background-color: #FFFFFF;
opacity: 1.0;
display: none;
height: 0 !important;
}
.opened{
min-height: 260px !important;
display: block;
}
.CSMsgContainer {
overflow-y: scroll;
height: 210px;
}
HTML:
<div id="SNbar">
<div id="chatSessions">
<div class="chatSession" id="Div4">
<div class="CStitle" onclick="toggleChatSession(this)"><span class="titleText">Title (With Whom)</span> </div>
<div class="CSbody">
<div class="CSMsgContainer">
<div class="message">b: test1</div>
<div class="message">b: this is used to test css</div>
<div class="message">a: This may be help</div>
</div>
</div>
</div>
<div class="chatSession" id="Div8">
<div class="CStitle" onclick="toggleChatSession(this)"><span class="titleText">Title (With Whom)</span></div>
<div class="CSbody">
<div class="CSMsgContainer">
<div id="Div9" class="message">d: hi C!!</div>
<div id="Div10" class="message">c: Hello D~~</div>
<div id="Div11" class="message">
c: We are the second chat session
</div>
</div>
</div>
</div>
</div>
</div>
position:absolute for the inner container is what you want. Then you can put it anywhere you want. Best is probably to set position:relative to the parent container, so that the position of the inner containers will using the parent as "base".
If I am not wrong, from this when you click on .CStitle, you are toggling the CSbody. So for this, you can set position relative to chatSession class and to the CSbody, give position absolute.
.chatSession {
position: relative;
padding: 0 10px 0 0;
width: 260px;
float: right;
z-index: 999;
}
.CStitle {
height: 25px;
background-color:#3B5998;
cursor: pointer;
}
.CSbody {
position:absolute;
background-color: #FFFFFF;
opacity: 1.0;
display: none;
height: 0;
bottom:25px;
}
.opened{
min-height: 260px;
display: block;
}
.CSMsgContainer {
overflow-y: scroll;
height: 210px;
}
Hope this helps.
try adding this
#SNbar {
height: 25px;
max-height: 25px;
}