I actually previously had a much longer question but I figured this would be the easiest to get situated. When I initially load my page, some of the items in the navigationBanner get displaced. But after I enter an order number in the text box and it reloads... everything is where it should be. I'm assuming my CSS is not loading when it should be, but I'm not entirely sure because I am entirely noobish at html and css.
Could anyone explain this to me?
Here's my html for the nav bar
<div id="background"><img src="images/blue%20background.jpg" alt="background" width="100%" height="100%" /></div>
<div id="header">
<div id="navigationContainerWrap">
<div id="navigationBanner">
<a href="">
<img src="images/facebook.png" alt="Facebook Link" border="0" style="margin: 4px 0 5px 44px;" /></a>
<a href="">
<img src="images/twitter-2.png" alt="Twitter Link" border="0" style="margin: 4px 0 5px 2px;" /></a>
<a href="">
<img src="images/pinterest-icon.png" alt="Pinterest Link" border="0" style="margin: 4px 0 5px 2px;" /></a>
<img src="images/txtNewCustomers.png" alt="New Customers txt" style="margin: 0px 0 5px 50px;" />
<img src="images/txtExistingCustomers.png" alt="Existing Customers txt" style="margin: 0 0 5px 50px;" />
<a href="">
<img src="images/email.png" alt="Email Link" border="0" style="margin: 4px 10px 6px 0;
float: left;" /></a>
<p style="float: left;">
1.800.BLAH.BLAH</p>
<a href="">
<img src="images/btnOrder.png" alt="New Customers Button" border="0" style="float: left;
margin: 0 0 0 45px;" /></a>
<a href="">
<img src="images/btnLogIn.png" alt="Log in Button" border="0" style="float: left;
margin: 0 10px 0px 25px;" /></
<!-- Order tracking Form input -->
<div class="trackingInput">
Order Status<br />
BloopBloop Order Number:<br />
<input id="txtOrderID" type="text" onkeydown="if (event.keyCode == 13) document.getElementById('btnOrder').click()" />
<input type="button" id="btnOrder" value="Submit" onclick="return btnOrder_onclick()" />
</div>
</div>
Annnnd what I believe is relevant CSS
.trackingInput
{
float: right;
/*padding: 0 5px 0px 0;*/
z-index: 35;
font-weight: normal;
font-family: "Century Gothic";
height: 85px;
margin-top: -45px;
position: relative;
margin-left: -1px;
width: 178px;
}
#navigationBanner
{
background-color: black;
background-repeat: no-repeat;
height: 85px;
width: 600px;
float: right;
color: White;
font-weight: bold;
font-size: small;
}
#navigationContainerWrap
{
background-position: center;
}
#header
{
background-color: White;
background-image: url(../Images/GenericLogo.png);
width: 960px;
height: 140px;
background-repeat: no-repeat;
margin: 0 auto;
position: relative;
z-index: 10;
}
Thanks in advance! And sorry for the info overload.
Possibilities:
You don't emit the same CSS both times
You don't emit the same HTML both times (e.g. you use different tags and/or classes)
One method to track this down using Internet Explorer:
Load your first page (the one that is not working as you expect) in IE
Hit F12 to open developer tools
Click on the Arrow icon in Developer Tools to enter Select mode
Click on a a part of your web page that isn't displaying correctly
Click on the Trace Styles tab (in Developer Tools)
Explore the style tree to see where each style is deriving from
Related
So my body is set at 1140px, however, I'd like my footer to be stretched across the screen. I have messed with so many codes, yet, I can't seem to find out what the reason is.. I have done a lot of research online and most people seemed to recommend margin: 0; but that didn't seem to help either.
There's so many codes behind this, that it seems like something else is messing with it.
footer {
background-color: #333;
width: 100%;
height: 320px;
position: relative;
}
.footer-body {
background-color: #333;
width: 60%;
height: 320px;
margin-left: 22%;
padding: 10px 0px 10px 20px;
position: relative;
color: #FFF;
font-family: 'Raleway', sans-serif;
}
footer p {
line-height: 20px;
margin: 10px 10px 0px 0px;
}
.map-address {
margin-top: 21px;
margin-bottom: 30px;
}
.footer-links {
color: #FFF;
font-size: 12px;
}
.widgetarea {
width: 100%;
text-align: center;
}
<footer>
<!--<div class="row">-->
<!-- Info Widget Start -->
<div class="footer-body">
<div class="col-lg-3 clearfix custom1" style="margin-top: 15px;">
<span style="font-size: 32px; font-weight: bold; color: #FFF;">ThanksOffice</span><span style="font-size: 32px; font-weight: bold; color: #ebb621;">.com</span>
<p style="font-size: 13px; line-height: 18px; color: #FFF;">ThanksOffice is a new concept of office space-sharing. Through ThanksOffice, everybody can share their unused spaces with flexible time-based options and also make a profit for sharing ThanksOffice with others</p>
</div>
<!-- Maps Widget Start -->
<div class="col-lg-4 col-sm-6 clearfix responsive-big-margin custom2">
<div class="map-address">
<span style="font-weight: bold; color: #fff; font-size:20px;">Contact Information</span><br>
<p>
<span style="color: #ebb621; font-weight: bold; font-size: 13px;">AddR:</span> <span style="color: #FFF; font-size: 13px;">3235 Satellite Blvd Bldg 400 Suite 290, Duluth, GA 30096</span>
<span style="color: #ebb621; font-weight: bold; font-size: 13px;">Email:</span> <span style="color: #FFF; font-size: 13px;">support#thanksoffice.com</span><br /><br />
</p>
<a href="https://www.facebook.com/tmpospro/?view_public_for=152376381930187" target="_blank">
<img src="/images/icon_facebook_white.png" width="20" style="margin-right: 20px;"></a>
<a href="https://www.instagram.com/tmposthanks/" target="_blank">
<img src="/images/icon_instagram_white.png" width="20" style="margin-right: 20px;"></a>
<a href="https://twitter.com/TMPOSTHANKS" target="_blank">
<img src="/images/icon_twitter_white.png" width="20" style="margin-right: 20px;"></a>
<a href="https://www.pinterest.com/tmposthanks/" target="_blank">
<img src="/images/icon_pinterest_white.png" width="20" style="margin-right: 20px;"></a>
<a href="https://www.youtube.com/channel/UCJGBaNOR3Y_ngsH4YoM-weg/featured?view_as=public/" target="_blank">
<img src="/images/icon_youtube_white.png" width="20" style="margin-right: 20px;"></a>
</div>
</div>
<!--<div class="widgetarea">-->
<!--</div>-->
<!-- Maps Widget End -->
<center>
<p class="footer-links">
<a target="_blank" href="/pdf/TERMS_OF_USE.pdf" style="font-size: 12px;">Terms of Use</a> |
<a target="_blank" href="/pdf/TXO-Privacy_Policy_Ver_1.0.1.pdf" style="font-size: 12px;">Privacy Policy</a> |
<a target="_blank" href="/pdf/Anti-Spam_Policy.pdf" style="font-size: 12px;">Anti-Spam Policy</a> |
<a target="_blank" href="/pdf/Electronic_Signature_Consent.pdf" style="font-size: 12px;">Electronic Signature Consent</a> |
<a target="_blank" href="/pdf/VR_NOTICE_TO_REPORT_USERS.pdf" style="font-size: 12px;">FCRA Agreement</a> |
<a target="_blank" href="/pdf/ThanksOffice.com_FAQ_Ver1.2.pdf" style="font-size: 12px;">FAQ</a> |
</p>
<p><span style="color: #fff;">© <%=DateTime.Now.Year%> TMPOS Inc. All rights reserved. <br />Powered by ESolutionTG</span></p>
<!--</div>-->
</div>
</div>
Set footer {position: absolute}
It sets your footer out of the html elements flow and the width of the body doesn't effect it.
I'm not sure the exact effect you are trying to achieve, but maybe try adding width: 100%; text-align: center; and remove margin-left: 22% in .footer-body
It looks like you didn't close <center> tag:
<!-- Maps Widget End -->
<center>
I assume that "<%-- --%>" is part of your template engine, but I removed them (not the HTML tags inside) and tried it on codepen and it works.
Plus what Ercan Peker suggested if you have fixed <body> width.
Like others have suggested, you can use position property to take the footer element out of any contained parent.
footer {
position: absolute;
left: 0;
bottom: 0;
width: 100vw; /* Make your footer span across the entire viewport */
}
There is a problem with my code where tiny underscores appear on the bottom-right corner of my anchor image. I have no idea how to fix it. I've heard answerers form other similar questions saying you have to add a closing </a> tag at the end, but that doesn't seem to be the problem, as I already have those tags included in my code. I also don't remember adding underscores into my code on purpose, so I have no idea how it can be removed.
<!DOCTYPE html>
<html>
<head></head>
<body style="background-image: url(https://img.michaels.com/L6/3/IOGLO/852866719/201341423/10151236.jpg?fit=inside|1024:1024);">
<button onclick="executeCommand()" style="border: 0; background: 0;"><img src="https://image.flaticon.com/icons/svg/54/54527.svg" style="padding: 5px 0px 0px 0px; width: 40px; height: 40px;"></button><div id="search"></div>
<br>
<a href="https://www.google.ca/" target="_blank"><img src="https://storage.googleapis.com/gweb-uniblog-publish-prod/images/Chrome__logo.max-2800x2800.png" alt="Google Chrome" style="width: 40px; height: 40px; padding: 0px 0px 5px 4px">
</a>
<br>
<a href="https://mail.google.com/" target="_blank"><img src="https://storage.googleapis.com/gweb-uniblog-publish-prod/images/Gmail_logo.max-2800x2800.png" alt="Google Mail" style="width: 40px; height: 40px; padding: 5px 0px 5px 4px">
</a>
<br>
<a href="https://docs.google.com/" target="_blank"><img src="https://seeklogo.com/images/G/google-docs-logo-6A8CD4F30A-seeklogo.com.png" alt="Google Docs" style="width: 30px; height: 40px; padding: 5px 0px 5px 9px">
</a>
<br>
<a href="https://www.youtube.com/" target="_blank"><img src="https://lh3.googleusercontent.com/Ned_Tu_ge6GgJZ_lIO_5mieIEmjDpq9kfgD05wapmvzcInvT4qQMxhxq_hEazf8ZsqA=w300" alt="Youtube" style="width: 40px; height: 40px; padding: 5px 0px 5px 4px">
</a>
</body>
</html>
Add this CSS line
a{
text-decoration: none;
}
I had the same problem. this person, is the answer:
"Put the “a” tag directly after the “img” tag, i.e. get rid of the newline (which will be parsed as a space). – user3603486 Apr 1 '18 at 15:13"
see my example att: anchor underscores:
This question already has answers here:
How to position text over an image with CSS
(8 answers)
Closed 7 years ago.
I am new to html and css. I am trying to make a website. I have four images on a line that works as links. When you hold the mouse over them, they turn transparent. I also want a headline to show up over the transparent image when you hold the mouse over it. But when I put text there it ends up on the line over the images instead of on top of them. The text also do not appear only when the mouse is over it, but it is there all the time. Here is my css:
p2 {
color: white;
font-size: 15px;
font-family: 'Verdana';
}
img {
box-shadow: 7px 7px 4px grey;
padding-left: 18px;
padding-right 18px;
}
img:hover {
opacity: 0.5;
filter: alpha(opacity=50);
}
Here is the html:
<p> TITLE THAT I WANT OVER THE FIRST IMAGE </p>
<a href="LINK1">
<img border="0" src="PHOTOLINK1" width="310" height="214">
</a>
<a href="LINK2">
<img border="0" src="PHOTOLINK2" width="310" height="214">
</a>
<a href="LINK3">
<img border="0" src="PHOTOLINK3" width="310" height="214">
</a>
<a href="LINK4">
<img border="0" src="PHOTOLINK4" width="310" height="214">
</a>
Please help me if you know how to do this, thank you. <3
Try assigning z-index css property to text
You can set your top margin to a negative value.
margin-top: -100px;
This is wrong:
p2 {
Change it with:
p {
You need to nest all the <a>s correctly. You didn't close a lot.
And a solution for you would be, you might need to change the code a little bit:
a {
position: relative;
}
span {
position: absolute;
color: white;
font-size: 15px;
font-family: 'Verdana';
bottom: 0;
left: 0;
right: 0;
background: #000;
}
img {
box-shadow: 7px 7px 4px grey;
padding-left: 18px;
padding-right 18px;
}
img:hover {
opacity: 0.5;
filter: alpha(opacity=50);
}
<a href="LINK1">
<img border="0" src="PHOTOLINK1" width="310" height="214" />
<span> TITLE THAT I WANT OVER THE FIRST IMAGE </span>
</a>
<a href="LINK2">
<img border="0" src="PHOTOLINK2" width="310" height="214" />
</a>
<a href="LINK3">
<img border="0" src="PHOTOLINK3" width="310" height="214" />
</a>
<a href="LINK4">
<img border="0" src="PHOTOLINK4" width="310" height="214" />
</a>
You can use position:absolute and put <p> child of <a> with a class
CSS
p2{
color: white;
font-size: 15px;
font-family: 'Verdana';
}
img {
box-shadow: 7px 7px 4px grey;
padding-left: 18px;
padding-right 18px;
}
img:hover {
opacity: 0.5;
filter: alpha(opacity=50);
}
.LINK1 p {
position: absolute;
top: 20px;
padding: 0px 20px;
}
HTML
<a href="LINK1" class="LINK1">
<p> TITLE THAT I WANT OVER THE FIRST IMAGE </p>
<img border="0" src="PHOTOLINK1" width="310" height="214">
</a>
<a href="LINK2">
<img border="0" src="PHOTOLINK2" width="310" height="214">
<a href="LINK3">
<img border="0" src="PHOTOLINK3" width="310" height="214">
<a href="LINK4">
<img border="0" src="PHOTOLINK4" width="310" height="214">
</a>
Note: Adjust your needs
DEMO HERE
I used a website called niftybuttons to generate an html code for social icons for my website. Can anybody tell me how I can center the icons and possibly add space between them?
HTML
<a href="http://facebook.com/makemoneywithjus" target="_blank">
<img src="http://www.niftybuttons.com/retro/32/facebook.png" align="left" border="0" style="margin:1px;"></a><a href="http://twitter.com/makemoneywitjus" target="_blank">
<img src="http://www.niftybuttons.com/retro/32/twitter.png" border="0" style="margin:1px;" align="left">
</a>
<a href="http://youtube.com/user/makemoneywithjus" target="_blank">
<img src="http://www.niftybuttons.com/retro/32/youtube.png" border="0" style="margin:1px;" align="left">
</a>
<a href="www.linkedin.com/pub/justina-cipriano/92/779/6b5/" target="_blank">
<img src="http://www.niftybuttons.com/retro/32/linkedin.png" border="0" style="margin:1px;" align="left">
</a>
<a href="https://plus.google.com/u/0/b/106075638630703080775/106075638630703080775/posts/p/pub" target="_blank">
<img src="http://www.niftybuttons.com/retro/32/google-plus.png" border="0" style="margin:1px;" align="left">
</a>
To add space between the Icons use padding
#list-left #set li a{
padding: 0 8px 0 0;
}
ul#set li:nth-child(2) {
display: table-cell;
padding: 10px 2px 10px 30px;
}
Try this fiddle: Demo
div{
position: relative;
left: 35%;
}
div a{
margin: 5px;
display: inline-block;
}
I need to align image on left and text on right. I am using the following css.
body {} #slideshow-nav {
width: 700px;
height: 30px;
position: absolute;
z-index: 999;
bottom: 0;
left: 11px;
text-align: center;
text-decoration: none;
}
#slideshow-nav a {
background: transparent url('../Image/bullet_grey - 1.png') 0 0 no-repeat;
width: 26px;
height: 26px;
text-indent: -999px;
display: inline-block;
text-decoration: none;
margin: 7px;
text-indent: -9999px !important;
margin: 7px;
text-decoration: none;
background-position: center;
border: none;
outline: none;
}
#slideshow-nav a.activeSlide {
background-position: 0 -1000px;
background: transparent url('../Image/bullet_red.png') 0 0 no-repeat;
display: inline-block;
background-position: center;
text-decoration: none;
border: none;
outline: none;
}
.page-slideshow {
position: relative;
margin-bottom: 15px;
text-decoration: none;
background: #d4ecef;
}
.page-slideshow.narrow #slideshow-nav {
width: 460px;
left: 0;
text-decoration: none;
}
.di-hero {
background: transparent;
width: 718px;
height: 300px;
background-position: 11px 0;
background-repeat: no-repeat;
}
p.more {
margin: 8px 0 0 0;
float: right;
overflow: hidden;
color: #BC1E04;
text-decoration: none;
color: #bc1e04;
margin: 5px 0 0 0;
text-align: center;
float: right;
}
h3 {
display: block;
color: #514c44;
font: 18px/24px Georgia, "Times New Roman", Palatino, "Palatino Linotype", "Book Antiqua", serif;
margin: 0 0 10px 0;
float: right;
overflow: hidden;
text-decoration: none;
margin: 5px 0 0 0;
text-align: center;
float: right;
}
div.slide-content img {
margin: 0 20px 0 0;
border: 5px solid #5999a2;
}
p {
color: #2e2e2a;
margin: 0 0 10px 0;
float: right;
overflow: hidden;
text-decoration: none;
font: 12px/18px Helvetica, "Lucida Sans", "Trebuchet MS", Arial, Verdana, sans-serif;
text-align: center;
float: right;
}
p.more:hover {
text-decoration: underline;
}
.slide-content {
width: 718px;
height: 300px;
background-position: 11px 0;
background-repeat: no-repeat;
}
<div class="page-slideshow narrow">
<div class="hero di-hero">
<div>
<a href="" title="Delicious Ideas from AllRecipes.com">
<div class="slide-content">
<img src="" width="152" height="150" alt="Delicious Ideas from AllRecipes.com">
<h3>Delicious Ideas from AllRecipes.com</h3>
<p>BI-LO has teamed up with AllRecipes.com to provide enhanced recipe searches, regionally inspired recipes, ratings, videos and more.</p>
<p class="more">Find the perfect recipe</p>
</div>
</a>
</div>
<div>
<a href="" title="Meal Planning Made Simple">
<div class="slide-content">
<img src="." width="152" height="150" alt="Meal Planning Made Simple">
<h3>Meal Planning Made Simple</h3>
<p>Whether you're preparing a romantic valentine's dinner or having friends over to watch the big game, our meal planning guide can help.</p>
<p class="more">Start planning today</p>
</div>
</a>
</div>
<div>
<a href="" title="Improve Your Wine & Beer IQ">
<div class="slide-content">
<img src="" width="152" height="150">
<h3>Improve Your Wine & Beer IQ</h3>
<p>The right glass of wine or beer can turn a good meal into a great one. Let us help you take the mystery out of beer and wine shopping.</p>
<p class="more">Learn the basics of wine and beer</p>
</div>
</a>
</div>
<div>
<a href="" title="Learn How to Pick the Perfect Meat">
<div class="slide-content">
<img src="." width="152" height="150" alt="Learn How to Pick the Perfect Meat">
<h3>Learn How to Pick the Perfect Meat</h3>
<p>We’ve got all of the information you need to help you choose the right type of meat for your meal.</p>
<p class="more">See our meat and seafood guide</p>
</div>
</a>
</div>
</div>
<div id="slideshow-nav">
<div>
</div>
</div>
</div>
Now my image is on the Left and text on the right. But it is not properly aligned. I need text on the same line and on the right to the image. Which style element is missing ..? please help me.
Here is the fiddle link
just added following css
.imgDes {
margin-left: 180px;
overflow: hidden;
text-align: left;
}
.imgDes p {
text-align: right;
}
<div class="slide-content">
<img src="http://static.adzerk.net/Advertisers/fdec4733b4814d9e958b7f86c25020b5.jpg" width="152" height="150" alt="Delicious Ideas from AllRecipes.com">
<div class="imgDes">
<h3>Delicious Ideas from AllRecipes.com</h3>
<p>BI-LO has teamed up with AllRecipes.com to provide enhanced recipe searches, regionally inspired recipes, ratings, videos and more.</p>
<p class="more">Find the perfect recipe</p>
</div>
</div>
I'm not sure if this actually helps you but here is how I probably would have done it:
.container {
width:500px;
}
.imageclass {
float:left;
width:200px;
height:20px;
}
.textclass {
float:left;
width:300px;
height:20px;
}
<div class="container">
<p class="imageclass"><img src... /></p>
<p class="textclass">text...</p>
</div>
I used this exact code in one page I did, and it worked fine getting the paragraphs in the same line. You can probably change the paragraphs for divs, and you of course have to change the numbers so it fits on your page.
<table width="100%">
<tr>
<td align="left" valign="top">image</td>
<td align="left" valign="top">text</td>
</tr>
</table>
this way the text and the picture are in the same line
You could allways use tables in divs (Fiddle example here) like this:
<div class="page-slideshow narrow">
<div class="hero di-hero">
<div>
<a href="" title="Delicious Ideas from AllRecipes.com">
<div class="slide-content">
<table>
<tr>
<td>
<img src="" width="152" height="150" alt="Delicious Ideas from AllRecipes.com" style="float:left" >
</td>
<td>
<h3>Delicious Ideas from AllRecipes.com</h3>
<p>BI-LO has teamed up with AllRecipes.com to provide enhanced recipe searches, regionally inspired recipes, ratings, videos and more.</p>
<p class="more">Find the perfect recipe</p>
</td>
</tr>
</table>
</div>
</a>
</div>
<div>
<a href="" title="Meal Planning Made Simple">
<div class="slide-content">
<table>
<tr>
<td>
<img src="." width="152" height="150" alt="Meal Planning Made Simple" style="float:left">
</td>
<td>
<h3>Meal Planning Made Simple</h3>
<p>Whether you're preparing a romantic valentine's dinner or having friends over to watch the big game, our meal planning guide can help.</p>
<p class="more">Start planning today</p>
</td>
</tr>
</table>
</div>
</a>
</div>
<div>
<a href="" title="Improve Your Wine & Beer IQ">
<div class="slide-content">
<table>
<tr>
<td>
<img src="" width="152" height="150" style="float:left" >
</td>
<td>
<h3>Improve Your Wine & Beer IQ</h3>
<p>The right glass of wine or beer can turn a good meal into a great one. Let us help you take the mystery out of beer and wine shopping.</p>
<p class="more">Learn the basics of wine and beer</p>
</td>
</tr>
</table>
</div>
</a>
</div>
<div>
<a href="" title="Learn How to Pick the Perfect Meat">
<div class="slide-content">
<table>
<tr>
<td>
<img src="." width="152" height="150" alt="Learn How to Pick the Perfect Meat">
</td>
<td>
<h3>Learn How to Pick the Perfect Meat</h3>
<p>We’ve got all of the information you need to help you choose the right type of meat for your meal.</p>
<p class="more">See our meat and seafood guide</p>
</td>
</tr>
</table>
</div>
</a>
</div>
</div>
<div id="slideshow-nav">
<div>
</div>
</div>
</div>