Page does not display correctly in firefox and opera - html

So I'm working on this site and for some reason a couple of the pages do not align correctly in firefox and opera, but work just fine in chrome, IE, and Safari. The basic construction is that I have a div with width, height=100%, within the Div i have a table to separate the sections of the page. The left and right side columns should be filling up the remainder of the width of the screen however in firefox and opera the columns have no width, but in IE, Chrome, and Safari they fill up the remainder. In playing with it if i remove the width parameters on the two middle cells it will line up correctly but this causes text alignment issues in chrome, IE, and Safari. How do I get the columns to fill up the page in all browsers?
Here is a link http://its.truman.edu/International/Meet_A_Student.htm
Here is my code,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Meet A Student</title>
<style type="text/css">
#outer {
opacity: .5;
}
#img1 {
opacity: .3;
}
#table1 {
opacity: 1;
}
</style>
</head>
<body style="margin: 0; background-image: url('Pictures/InternationalAppeal- HomepageColor.jpg'); width:100%; height:100%; clip:auto; overflow:hidden;">
<div style=" position:absolute; height:100%; margin:0px auto">
<table style="width: 100%; height:100%; border-collapse:collapse">
<tr>
<td rowspan="4" style="background-color:#2BA7D0; margin-right:0px; height:100%;" id="outer" >
</td>
<td colspan="2" style="text-align: center; background-image: url('Pictures/Header_New.jpg');width:960px; height:100px" valign="bottom" >
<table style="width: 100%; border-collapse:collapse">
<tr>
<td style="width:20%"> <a href="/International/Home.htm">
<button type="button" style="color: black;background: #2BA7D0; border:0; height:50px; width:100%">
<span style="font-family:Calibri; font-size:16pt;font-weight:bold">
Home
</span>
</button>
</a></td>
<td style="width:20%">
<button type="button" style="color:white; background:#FA7042; border:0; height:50px; width:100%;">
<span style="font-family:Calibri; font-size:16pt;font-weight:bold">
Meet A<br/> Student
</span>
</button>
</td>
<td style="width:20%"> <a href="/International/Available_Funds.htm">
<button type="button" style="border-style: none; border-color: inherit; border-width: 0; background: #2BA7D0; height:50px; width:100%">
<span style="font-family:Calibri; font-size:16pt;font-weight:bold; WORD-WRAP:break-word">
Available <br /> Funds
</span>
</button>
</a></td>
<td style="width:20%"> <a href="/International/Contact.htm">
<button type="button" style="color:black; background:#2BA7D0; border:0; height:50px; width:100%;">
<span style="font-family:Calibri; font-size:16pt;font-weight:bold">
Contact <br/> Truman
</span>
</button>
</a></td>
<td style="width:20%"> <a href="/International/Give.htm">
<button type="button" style="color:black; background:#2BA7D0; border:0; height:50px; width:100%;">
<span style="font-family:Calibri; font-size:16pt;font-weight:bold">
Give
</span>
</button>
</a></td>
</tr>
</table>
</td>
<td rowspan="4" style="background-color:#2BA7D0; height:100%;" id="outer">
</td>
</tr>
<tr>
<td style="width:480px" >
<div>
<img alt="Wanding Shi" src="Pictures/Wanding Shi.jpg" style="float: left; margin-right:10px" width="258" height="389"/>
<div>
<p style="font-family:Calibri">
<span style="font-size:16pt">
Wanding Shi
</span><br />
Senior Business Major<br />
<br />
Home Country - China<br />
<br />
"I enjoy the environment at Truman and have
gotten involved in Phi Beta Lambda and the
Bulldog Investment Fund. I am grateful for
the opportunity to get to know students from
different countries while at Truman."
</p>
</div>
</div>
</td>
<td style="width:480px">
<div>
<img alt="Babajide Adio" src="Pictures/Babajide_Adio.jpg" style="float: left; margin-right:10px" width="240" height="389" />
<div>
<p style="font-family:Calibri">
<span style="font-size:16pt">Babajide
Adio</span><br />
Senior Biology Major<br />
<br />
Home Country - Nigeria<br />
<br />
"At Truman, I have enjoyed great opportunities
to do research with professors since my freshman
year. I have also gotten involved in a lot of
student organizations including honors
organizations, the African Students Association
and Intramural Soccer and Basketball. The
community is very friendly, and it is easy for
every student to find his or her niche. Since
international students don't qualify for many
scholarships because of citizenship, it would be
wonderful to receive support for international
students."
</p>
</div>
</div>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center; width:20%; background-image:url('Pictures/Footer_New.jpg')" class="style6" >
<div id="table1"> <table id="table1" style="border-collapse:collapse; width:960px">
<tbody>
<tr>
<td style="text-align:right;font-family:Calibri;margin-bottom:0px; ,margin-top:0px" valign="bottom" >
<p style="font-family:Calibri;font-size:20pt; text-align:center;margin-bottom:0px;margin-top:0px" >
<a href="https://secure.truman.edu/alumni-s/contribution_new.asp" style="text-decoration:none; color:black">
Make a Contribution
<span style="color: #FA7042; font-weight:bolder">
TODAY!
</span>
<span style="text-decoration: underline">
<br/>click here
</span>
</a>
</p>
</td>
<td style="text-align:right;font-family:Calibri;">
<span style="font-size:14pt;font-weight:bold; padding-right:40px">
Truman State University
</span> <br />
<span style="font-size:12pt">
Office of Advancement | McClain Hall 205 <br />
100 E. Normal Avenue |Kirksville, MO 65301</span>
</td>
<td style="font-family:Calibri;border-left-style: solid;border-left-width: 1px; margin-left:10px; text-align:left">
<span style="font-size:14pt;font-weight:bold;padding-left:50px">
<a href="www.truman.edu">
www.truman.edu
</a>
</span>
<br />
<span style="font-size:12pt; margin-left:5px;">
(660) 785-4133 or (800) 452-6678
</span>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr>
<td colspan="2" style="background-color:#2BA7D0; margin-right:0px; height:100%" id="outer" class="style3">
<br />
<br />
</td>
</tr>
</table>
</div>
</body>
</html>

I suggest the following for you main div and body style:
<body style="margin: 0; background-image: url('Pictures/InternationalAppeal-
HomepageColor.jpg'); clip:auto; overflow:hidden;">
<div style="margin:0px auto">.....
Ok and for the content: Why do you have so many Divs inside your table? The use of a table defeats the need for using a Div in most cases, so I suggest you take out all the divs in the table. If you want something to behave like a block element such as the images, set display: block or inline-block.
As for all the dimensions: You defined too many widths and heights. Do not assign the widths in pixels to the td tags, the size of the images will do their job. You can specify their dimensions. Try that and let me know.

"for some reason a couple of the pages do not align correctly in firefox and opera"
You can quikly fix that problem by adjusting this part of your code:
CHANGE THIS:
<body style="margin: 0; background-image: url('Pictures/InternationalAppeal- HomepageColor.jpg'); width:100%; height:100%; clip:auto; overflow:hidden;">
<div style=" position:absolute; height:100%; margin:0px auto">
TO:
<body style="margin: 0; background-image: url('Pictures/InternationalAppeal- HomepageColor.jpg'); width:100%; height:100%; clip:auto; overflow:hidden;">
<div style=" position:relative; height:100%; margin:0px auto">
The issue is that if you give position:absolute; your are removing the element from the normal document work-flow, thus causing the margin: 0 auto; to be meaningless.
What I did was to change the position:absolute; to position:relative; thus having the margin:0 auto; being "respected" by the browser.
EDITED
To solve the mentioned issue on your comment, you just need to set the html height to 100%;.
CSS
html {
height: 100%;
}
Note: This will tell the browser that the document has a height of 100%, thus causing the body and body>div height of 100% to extend till the end of the document.

Related

why my logo is visible in all browsers but not visible in their print views

I'm stuck with a problem. I need to print the page with the logo but the problem is that the logo is shown in the browser but in the print preview (CTRL P) the logo is not displayed.
For any guidance I would be very thankful.
This is the html code and css media print code
/* ## removed here since they are specific to ASP.NET MVC */
#media print {
#page {
size: A4 landscape;
max-height: 100%;
max-width: 100%;
position: fixed;
}
.prints {
height: 19.2cm;
page-break-after: avoid;
border: black 1px solid;
}
.row {
page-break-after: avoid;
}
}
/*! Generated by Font Squirrel (https://www.fontsquirrel.com) on July 30, 2018 */
label {
font: c
}
<table align="center" style="padding-left:10px;">
<tbody>
<tr>
<td colspan="3">
<h4 style="text-align:center;padding-left:25px; font-family:Calibri"><b> CHALLAN FORM </b></h4>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
<div>
<label style="padding-left:10px;width:145px;">
<span style="line-height:1; width: 135px; font-size:26px; font-family:'Chursaechsische Fraktur';"><strong>Baitul Huda</strong></span>
<span style="line-height:1;border:0px; width:100px; font-size:12px; font-family:'Adobe Devanagari';">High School For Girls</span>
</label>
</div>
</td>
<td rowspan="2" style="width:30px;padding-right:0px; padding-left: 10px;">
<img src="~/images/nku_02.png" height="70" width="70" alt="Bail ul huda logo" />
</td>
<td style="padding-left:10px;">
<div style="padding-left:5px;">
<label style="width:120px;padding-top:0px;padding-bottom:0px;">
<span style="line-height:0; width: 160px; font-size:26px; font-family:'UL Sajid Heading';">بیت الھدیٰ</span>
<span style="line-height:1; width:100px;padding-left:10px; font-size:16px; font-family:'Al Qalam Quran 2A';"> ھایئ سکول فارگرلز</span>
</label>
</div>
</td>
</tr>
</tbody>
</table>
I Found the solution
Img is not coming in print view because there is a missing of a div
<td rowspan="2">
<div style="padding-left:10px;width:80px;height:50px">
<img src="/images/offical_Logo_Baitul_Huda.jpeg" class="img-responsive" style="height:50px ; width:100px" alt="">
</div>
</td>
As i add the div the logo start displayed in print view

Positioning the text inside the cell

I have this JSFiddle: Click here
<table class="findus-main-table">
<tr>
<td>
<img class="static-map" onClick="swap();" id="static-map-id" />
</td>
<td style="text-align: center; vertical-align:bottom; position: relative;">
<span style="font-size: 22px; font-weight: bold;">The address I want here</span>
<!-- the inner table for location and distance and phone number -->
<table style="text-align:left;" cellspacing="10">
<tr>
<td style="vertical-align:top">
<div>
<div>Phone: (613)-123-1234</div>
<div>Distance: 0.123km</div>
</div>
</td>
<td>
<div><b>Store Hours</b>
</div>
<div>Mon - Fri: 8am - 2am</div>
<div>Sat & Sun: 10am - 12am</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
What I want is to position the address to the top while the phone number and hours stays at the bottom. I tried using absolute but it wraps the text of the address which i really dont want.
How can I do it?
besides the fact that you shouldn't be using inline styling, is this what you're looking for?
<span style="font-size: 22px; font-weight: bold;position: absolute;top: 0;left: 0;right: 0;">
FIDDLE
instead of using position:absolute witch should be the last thing anyone should try ,I use vertical-align:top
here is a fiddle.and here is my css :
.address{
text-align:center;
font-size:22px;
text-align: center;
font-size: 22px;
height: 78px;
padding: 0;
vertical-align: top;
}

why does my table show up in one cell

My table keeps show up in one cell, not sure what i did wrong. anyone willing to look and let me know where i went wrong.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="main.css">
<title>Ironton Fire department Sponsors</title>
</head>
<body>
<div style="width:1020px; height:1020px; float:center; background- image:url(images/zombie_5k_TM_AP_stripped.png)">
<div class="home">
<img src='images/home_button.jpg' name="register" onMouseOver="this.src='images/home_button_hover.jpg'" onMouseOut="this.src='images/home_button.jpg'" onclick="location.href='index.html'"/>
</div>
<div class="register">
<img src='images/register_button.jpg' name="register" onMouseOver="this.src='images/register_button_hover.jpg'" onMouseOut="this.src='images/register_button.jpg'" onclick="location.href='register.html'"/>
</div>
<div class="sponsor">
<img src='images/sponsor_button.jpg' name="sponsor" onMouseOver="this.src='images/sponsor_button_hover.jpg'" onMouseOut="this.src='images/sponsor_button.jpg'" onclick="location.href='sponsors.html'"/>
</div>
<div class="gallery">
<img src='images/gallery_button.jpg' name="gallery" onMouseOver="this.src='images/gallery_button_hover.jpg'" onMouseOut="this.src='images/gallery_button.jpg'" onclick="location.href='gallery.html'" />
</div>
<div class="sponsors">
<table>
<tr>
<td align="center" width="250">Seth Jackson - Edward Jones</td>
<td align="center" width="250">Heritage Mechanical </td>
</tr>
<tr>
<td align="center" width="250">Mike Flanagan – Iron Range Auto </td>
<td align="center" width="250"> </td>
</tr>
</table>
</div>
<div class="sform">
< p align="center">
<a style="color: #D91D1F;"href="Images/ZX5K Sponsorship Agreement.pdf" target="_blank">ZX5K Sponsorship Agreement</a></p></div></div>
</body>
</html>
here is the css that covers the class .sponsors
.sponsors {
position: absolute;
top: 280px;
left: 340px;
}
here is the link to see what i am talking about, http://www.ifdauxzx5k.com/sponsors.html
Your table doesn't show up in one cell.
But all the cells are on top of eachother, because you have position: absolute; on your TD in your main.css line 62.
td{
color: #D91D1F;
position: absolute;
}
This is why every TD is going to the left top position of the table. Remove this line and it will behave correctly.

My code doesn't work in Chrome or Safari

I have been working on creating a website for a family company. It is mostly created, however I cannot get it to work in Chrome or Safari. Specifically, the links to go from page to page do not work. When clicking on the tabs on the left side, or the logo at the top, you should be directed to a different page. This works perfectly on IE. However, they do not work at all in the other 2. I have looked and looked and can't find a reason why. If anybody could help, it would be greatly appreciated.
I realize that the tabs are not uniform in Chrome or Safari as they are in IE. That is just not as important an issue to fix at the moment.
Here is the HTML for one of the pages so you can see what I have done and where I have messed up.
<!DOCTYPE html>
<html>
<head>
<title>
BERK Consulting LLC
</title>
<style type="text/css">
a:link {color:white; }
a:visited{color:white; }
a:hover {color:white; }
body {background-color:#F2E8DE}
</style>
<script type="text/javascript">
</script>
</head>
<body>
<div id="Main" style="padding-left:150px; position: absolute; width: 800px;">
<p style="font-size: 18pt; text-align: justify; padding-top: 200px; padding-left: 200px;">
BERK was founded on the desire to remove the bureaucracy, complexity, and hidden agendas from consultancy. When you deal with BERK, you’re dealing directly with the expertise, not a salesperson or a subcontracting agency. <br /> <br />
Our down-to-earth approach combined with extensive 'in the seat' supply chain expertise allows us to advise you on key supply chain evolution decisions, allowing you to maintain focus on managing your business. <br /> <br />
We have eliminated the green beans from our team so that we can establish sustainability in your team and at an affordable rate.
</p>
<p style="text-align: right; font-size: 20pt;"> <strong>
...Securing the Last Piece® <br />
<img src="http://berkllc.com/images/LinkedIn2.png" alt="Follow Us" style="float:right;" width="150px" />
</strong> </p>
</div>
<div id="Tabs" style="background-color:#502800; text-align:right; width:280px; padding-bottom:400px; padding-top:50px; padding-left:20px;">
<img src="http://berkllc.com/images/BERKPic1.jpg" alt="BERK" />
<p style="font-size:11pt; padding-top:50px; ">
<span style="font-family:'Copperplate Gothic Bold'; ">
Home <br /> <br />
Who We Are <br /> <br />
What We Do <br /> <br />
Who We've Helped <br /> <br />
Our Network <br /> <br />
What Are You Missing <br /> <br />
Contact Us <br />
</p>
</span>
</div>
<div id="blank" style="width:100%; padding-top:1px;">
</div>
<div id="Legal1" style="background-color:#1F497D; position: absolute; padding-top:125px; width:994px; text-align:center;">
<table id="Legal2" border="0" style="border-collapse:collapse; font-size:8pt; color:white; margin-left: auto; margin-right: auto;" cellpadding="10px">
<tr>
<th style="cursor: pointer;" onclick="location.href='index.html'">
Home
</th>
<th style="cursor: pointer;" onclick="location.href='BERKContactUs.html'">
Contact Us
</th>
<th style="cursor: pointer;" onclick="location.href='BERKDisclaimers.html'">
Legal Disclaimers
</th>
<th style="cursor: pointer;" onclick="location.href='BERKTrademark.html'">
Trademark/Privacy
</th>
<th style="cursor: pointer;" onclick="location.href='BERKSitemap.html'">
Site Map
</th>
</tr>
</table>
<p style="text-align:center; font-size:6pt; color:white;">
© 2009 BERK Consulting, LLC. All Rights Reserved.
</p>
</div>
</body>
</html>
This is sloppy but add
z-index: 900;position: relative;
to the style for:
<div id="Tabs" style="background-color:#502800; text-align:right; width:280px; padding-bottom:400px; padding-top:50px; padding-left:20px;z-index: 900;position: relative;">
and add
z-index: 1;
to the styles for
<div id="Main" style="padding-left:150px; position: absolute; width: 800px;z-index: 1;">
On an unrelated note I would recommend giving this site or this site a visit if you want to learn good practices and style for html/css/javascript.
The problem is that your "Main" div is covering up the links. And just as I start typing this, I'm called away. In any case, do not trust IE to do this right. Trust Chrome first.

CSS HTML organize 5 images - cross-browser compatible

I've got 5 images I'd like to organize in an ASP.NET MVC view. So what I need is an HTML+CSS solution (I prefer not to use jQuery for this, for maximal compatibility).
I want to organize the images like so:
Image1 Image2
Image3 Image4
Image5
At first I tried using tables, with the HTML being:
<div class="table1">
<table border=1>
<tbody>
<tr>
<td>
<img class="mainArticleImage" src="../../images/fixedImages/dr_teman_Articles_Body.Contouring.jpg" />
</td>
<td>
<p class="ImageCenterContainer">
<img class="mainArticleImage" src="../../images/fixedImages/dr_teman_Articles_Breast.jpg" />
</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="table2">
<table border=1>
<tbody>
<tr>
<td>
<p class="ImageCenterContainer">
<img class="mainArticleImage" src="../../images/fixedImages/dr_teman_Articles_Skin.jpg" />
</p>
</td>
<td>
<p class="ImageCenterContainer">
<img class="mainArticleImage" src="../../images/fixedImages/Dr_teman_Articles_Face.jpg" />
</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="table3">
<table border=5>
<tbody>
<tr>
<td>
<p class="ImageCenterContainer">
<img class="mainArticleImage" alt="" src="../../images/fixedImages/Dr_teman_Articles_Face.jpg" />
</p>
</td>
</tr>
</tbody>
</table>
</div>
and the css part:
.mainArticleImage {
height: 95px;
width: 120px;
}
.ImageCenterContainer {
margin: 0 auto;
margin-top:0px;
margin-bottom:0px;
padding:0px;
text-align:center;
}
but that doesn't work on IE.
This approach also didn't work too well either.
What is the best, simplest, cross-browser way to carry out what would seem to be an easy task?
How about this: http://jsfiddle.net/um6d7/
#Brian Flanagan
(this reply was too long for a comment)
I'm using IE8, but this solution should work for older IE versions as well. Shouldn't it to be fairly simple to organize 5 pictures on a screen? :-P
I should also mention that I didn't copy and paste your solution "as is", since I didn't want my css to refer to general tags such as img and div, but the changes are meaningless in terms of logic. The actual code I used:
HTML:
<div id="imagesContainer">
<img class="articleImage" src="http://upload.wikimedia.org/wikipedia/commons/1/18/Ocellaris_clownfish.JPG" />
<img class="articleImage" src="http://upload.wikimedia.org/wikipedia/commons/1/18/Ocellaris_clownfish.JPG" />
<img class="articleImage" src="http://upload.wikimedia.org/wikipedia/commons/1/18/Ocellaris_clownfish.JPG" />
<img class="articleImage" src="http://upload.wikimedia.org/wikipedia/commons/1/18/Ocellaris_clownfish.JPG" />
<img class="articleImage middle" src="http://upload.wikimedia.org/wikipedia/commons/1/18/Ocellaris_clownfish.JPG"/>
</div>​
CSS:
#imagesContainer {width:550px; overflow:hidden;}
.articleImage {width:180px; float:left; display:inline; margin:15px;}
.middle {margin:15px 90px;}
any suggestions?