My code works fine in Chrome, however when I run it in Firefox, there is a problem. My webpage has 2 roman style columns ( each column consists of 2 images, a top and a bottom )that run vertically from the bottom of the header to the top of the footer. But in Firefox they stop about 30px from the top of the footer, leaving a gap.
My code does not include any vender prefixer's, but when I ran my CSS through Autoprefixer.com it did not add any either. Here is the code that seems to be affected.
<!--Roman Columns-->
<div class="content">
<div id="col_topleft">
<img src="imagesC/col_topleft.png" alt="column" height="420" width="60">
</div>
<div id="col_topright">
<img src="imagesC/col_topright.png" alt="column" height="420" width="60">
</div>
<div id="col_bottleft">
<img src="imagesC/col_bottleft.png" alt="column" height="685" width="60">
</div>
<div id="col_bottright">
<img src="imagesC/col_bottright.png" alt="column" height="685" width="60">
</div>
/*Roman Columns*/
#col_topleft {position: absolute;
top: 220px;
left: 25px;
}
#col_topright {position: absolute;
top: 220px;
right: 25px;
}
#col_bottleft {position: absolute;
top: 640px;
left: 25px;
}
#col_bottright {position: absolute;
top: 640px;
right: 25px;
}
This should fix the problem.
First add a div with position:relative than drop your content inside that div
<div style="position:relative;">
<div style="position:absolute"> <!-- your content div -->
</div>
</div>
Related
I have a problem I just can't seem to solve despite following directions in my previous post, I just began learning html/css. This is my button as it appears right now:
here
& this is where I would like it to appear. It does not seem to move despite changing the top, left or bottom:
here
& this is where I want it to be. The background is simply an image its not multiple divs. this is the only code I have:
<section>
<div class="content">
<div class="container">
<div class="wrap">
<div class="fix-7-12">
<div><p class="ae-2">
<button style{
top: 100px;
right: 1000px;
left: 10000000px;
}
>Try yourself</button
>
</p></div>>
</div>
</div>
</div>
</div>
<img
src="assets/img/background/fire2.png"
width="1450"
height="850"
></img>
</section>
I think you should use left, top etc. styles with percentages. If we look at the center of the button in the second picture:
top: 35%, left: 60%
Also, you should change display to block in order to see the button as a rectangle element. I gave also width and height. You can change them if you want.
So, I changed your HTML code as:
<section>
<div class="content">
<div class="container">
<div class="wrap">
<div class="fix-7-12">
<div><p class="ae-2">
<button
style="position: absolute; display: block; top: 35%; left: 60%;
width: 120px; height: 60px;">
Try yourself
</button>
</p></div>
</div>
</div>
</div>
</div>
<img
src="assets/img/background/fire2.png"
width="1450"
height="850"
>
</section>
These are the screenshots:
There are a few mistakes in your HTML. Firstly, the style attribute needs to be a string. The position attribute needs to be first. So it would be "position: absolute;top: 100px;right: 1000px; left: 10000000px;". img tags do not have a closing tag.
Correct HTML:
<section>
<div class="content">
<div class="container">
<div class="wrap">
<div class="fix-7-12">
<div><p class="ae-2">
<button style="position: absolute;top: 100px;right: 1000px; left: 10000000px;"
>Try yourself</button
>
</p></div>>
</div>
</div>
</div>
</div>
<img
src="assets/img/background/fire2.png"
width="1450"
height="850"
>
</section>
I have image folders like body,collar,sleeves and cuffs and inside there i have images. Actually I have four images I want stack all these images together in their places.
Below is my html,
<div id="myJershy">
<img src="image/Pngs/collar/White.png" id="grey" style="position: fixed; top: 8px; left: 12px; width: 935px;">
<img class="orange" id="orange" src="image/Pngs/body/White.png" style="position: fixed; left: 10px; top: 8px;">
<img src="image/Pngs/sleeves/White.png" id="gold" style="position: fixed; top: 12px; left: 22px;">
<img class="back" id="black" src="image/Pngs/cuffs/White.png" style="position: fixed; left: 11px; top: 9px;">
</div>
How to make that div images together. Please help me someone.
If you want all images on the very same position and put them "together", you could simply do this:
#myJershy img {
position: absolute;
}
<div id="myJershy">
<img src="image/Pngs/collar/White.png" id="grey">
<img class="orange" id="orange" src="image/Pngs/body/White.png">
<img src="image/Pngs/sleeves/White.png" id="gold">
<img class="back" id="black" src="image/Pngs/cuffs/White.png">
</div>
However, if you want everything to be at different locations, I'd if possible recommend using a tool such as Paint.net, Gimp or Photoshop to put them together there instead. If that is not possible however, you got yourself a challenge as you'll need to use absolute locations like you have tried yourself.
I'm trying to put some text over image and it isn't working. It just puts my text under my image and I can't bring it up.
My code:
.Happylady {
position: relative;
width: 100%;
}
.Happylady p {
float: left;
position: absolute;
left: 0;
top: 80px;
width: 100%;
}
<div class="Bannerimage">
<img src="content/severroom.png" class="centerimage" />
<p>Check out speeds up to 60Mbps!</p>
<button >View Packages!</button>
</div>
<div class="Internet">
<div class="Information">
<h3>INTERNET</h3>
<h7>CABLE, DSL & RURAL WIRELESS</h7>
</div
<div class="HappyLady">
<img src="content/happylaptoplady.png" alt="" />
<div class="contents">
<h4 class="Pricing">From <span class="Dollar">$29.99</span> per month!</h4>
<div class="Benefits">
<p>UNLIMITED PLANS AVAILABLE</p>
<p>NOW WITH LOWER PRICES</p>
<p>FASTER SPEEDS - UP TO 60 MBPS!</p>
</div>
</div>
</div>
</div>
<div class="Phone">
<h3>PHONE</h3>
<h7>RESIDENTIAL & COMMERCIAL</h7>
</div>
<div class="Television">
<h3>TELEVISION</h3>
<h7>SHAW DIRECT / INTERNET TV</h7>
</div>
Edit: I've added my entire HTML code... that may show where I'm going wrong.
Your class is misspelled in your CSS and you're positioning all your paragraphs over top of each other. You need to wrap your content in a container and position it. Also you won't need that float.
.HappyLady {
position: relative;
width: 100%;
}
.HappyLady div.contents {
position: absolute;
left: 0;
top: 80px;
width: 100%;
}
<div class="HappyLady">
<img src="http://placehold.it/400x400" alt="" />
<div class="contents">
<h4 class="Pricing">From <span class="Dollar">$29.99</span> per month!</h4>
<div class="Benefits">
<p>UNLIMITED PLANS AVAILABLE</p>
<p>NOW WITH LOWER PRICES</p>
<p>FASTER SPEEDS - UP TO 60 MBPS!</p>
</div>
</div>
</div>
Try to refactor your code using the image as a background-image:
.HappyLady {
position: relative;
width: 100%;
background-image: url('http://truespeed.ca/wp-content/uploads/2016/06/happylaptoplady.png');
background-size:100% 100%;
}
and remove the image tag from your code.
So I have a theatre view for pictures( just like Facebook when clicking on a picture) and every time I resize the browser I want the picture to be resized along with the browser, I have tried many things, nothing seems to be working.
Here is the html:
<div class="fullView" id="photoView" alt="close">
<div class="tableDisp">
<div class="tableCell" id="tableCell">
<div class="_n3">
<div class="theatreFloated">
<div class="theatreHolder">
<div class="imageHolder clearfix">
<img class="imageTheatre" id="imageTheatre" src="#">
</div>
</div>
</div>
<div class="infoHolder">
<div class="photoUser">
<p>gabryel</p>
</div>
</div>
<div class="exitView">
<img src="<? echo APP_PATH; ?>public/cuts/exit.png" width="15px" title="Close">
</div>
</div>
</div>
</div>
</div>
The CSS:
.fullView{position:absolute;background:rgba(0,0,0,0.9);height:100%;width:100%;z-index:400;top:0px;bottom:0px;min-height:100%;display:none;}
.fullView .tableDisp{height:100%;width:100%;display:table;}
.tableCell{display:table-cell;vertical-align:middle;text-align:center;}
._n3{display:inline-block;margin:20px;position:relative;overflow:hidden;padding:10px;}
.theatreFloated{float:left;}
.theatreHolder{position:relative;height:500px;width:500px;background:black;display:table-cell;vertical-align:middle;}
.imageTheatre{max-width: 100%;height: auto;width: auto\9;display:inline-block;vertical-align:middle;}
.infoHolder{width:300px;background:#5B748A;float:left;text-align:left;}
.exitView{position:absolute;right:5px;top:5px;cursor:pointer;}
Thank you for the help.
I think you're over-complicating the problem here... All you really need to resize the image depending on the browser window is setting its max-height and max-width as a % relative to the window size. Simplify your theatreview type HTML to:
<div class="fullview" id="photoview" alt="close">
<img class="imageTheatre" id="imageTheatre" width="auto" src="#" />
<span> Image by blah blah... </span>
<div class="exitView">
<img src="<? echo APP_PATH; ?>public/cuts/exit.png" width="15px" title="Close">
</div>
</div>
Then you can actually start setting these as % relative to the window in your css:
#fullview{ position: absolute; width: 100%; height: 100%; left: 0; top: 0; }
#imageTheatre{ position: relative; max-width: 80%; max-height: 80%; display: block; margin: 0 auto; }
#fullview span{ position: relative; display: block; margin: 20px auto; width: 400px; }
then resize your screen and the image will resize... I haven't tested the code, so I am just giving this to you as a simple method which I have used in the past!
Good luck!
I'm trying to create two side by side divs in a wrapper. The first div, #content, is a position:relative div.
#wrapper {
background-image: url(assets/images/BG2.gif);
margin-right: auto;
margin-left: auto;
width: 996px;
overflow: auto;
}
#content {
position: relative;
top: 10px;
left: 10px;
width: 745px;
background-color: red;
}
#important {
float: right;
position: relative;
top: -1120px;
width: 231px;
margin-right: 10px;
background-color: green;
}
The problem is that the second div, #important, is displayed under the first one. There is enough space for both divs and the padding/margins. I can make it work by floating it to the right and using a negative top position and it displays fine, but I feel as though there is a better/correct way of doing this.
HTML:
<div id="wrapper">
<div id="content">
<img src="assets/photos/bid day 046.jpg" alt="Bid Day" width="745" height="311" />
<div id="fraternity">
<p align="center"><span class="style5"><strong>TITLE</strong><br />
Subtitle<br />
Sub-subtitle</span></p>
<p align="justify">depry derp</p>
<p align="justify">derp derp derp</p>
<p class="style5" align="center"><br/><strong>Title<br/>
Twitter Feed</strong></p>
<div id="twitter">
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>...</script>
</div>
</div>
<div class="fb-like-box" data-href="something" data-width="292" data-colorscheme="dark" data-show-faces="false" data-stream="true" data-header="false">
</div>
</div>
<div id="important">
<p align="center"><strong>IMPORTANT INFORMATION</strong><br />Derp!</p>
<img class="divider" src="assets/images/hr.gif" alt="HR" width="183" height="15" />
<p align="center"><strong>Achievements<br /></p>
<img class="divider" src="assets/images/hr.gif" alt="HR" width="183" height="15" />
<p align="center" class="style11"><strong>UPCOMING EVENTS<br /></strong>stuff<br /></p>
<p align="center"><br /> <strong>more stuff</strong><br /></p>
</div>
</div>
Make the #wrappers position be relative or absolute.
Then set the inner div positions to be absolute.
jsfiddle example: http://jsfiddle.net/kRHTj/
I would float them both left or right.