I have some problems skinning a rounded corner table.
Take a look at the image please:
And here goes the code:
<table id="whitePanel" width="190px" cellpadding="0" cellspacing="0" border="0" >
<tr>
<td>
<img src="assets/images/lightRoundedCorners/tl.png" width="8" height="8" border="0" alt="..." />
</td>
<td>
<img src="assets/images/lightRoundedCorners/t.png" alt="..." height="8" width="100%" />
</td>
<td>
<img src="assets/images/lightRoundedCorners/tr.png" width="8" height="8" border="0" alt="..." />
</td>
</tr>
<tr>
<td>
<img src="assets/images/lightRoundedCorners/l.png" width="8" alt="..." height="100%" border="0"/>
</td>
<td align="center" border="0" style="background: url(assets/images/lightRoundedCorners/c.png) repeat">
ACTUAL CONTENT
<p>1. Item 1</p>
<p>1. Item 1</p>
<p>1. Item 1</p>
</td>
<td>
<img src="assets/images/lightRoundedCorners/r.png" width="8" alt="..." height="100%" border="0"/>
</td>
</tr>
<tr>
<td>
<img src="assets/images/lightRoundedCorners/bl.png" width="8" height="8" border="0" alt="..." />
</td>
<td>
<img src="assets/images/lightRoundedCorners/b.png" alt="..." height="8" width="100%" border="0"/>
</td>
<td>
<img src="assets/images/lightRoundedCorners/br.png" width="8" height="8" border="0" alt="..." />
</td>
</tr>
Any suggestions?
I am going to scalp you for using tables for non tabular data,
For god's sake man it's 2011 use divs and css!
http://css-discuss.incutio.com/wiki/Why_I_think_divs_are_better_than_tables
One solution could be to use css only without images to achieve what you need. check the following:
css
table {
-moz-border-radius: 6px; /* FF1+ */
-webkit-border-radius: 6px; /* Saf3-4 */
border-radius: 6px; /* Opera 10.5, IE9, Saf5, Chrome */
-moz-box-shadow: 0 0 6px #959595 inset;
-webkit-box-shadow: 0px 0px 6px #959595 inset; /* Saf3.0+, Chrome */
box-shadow: 0px 0px 6px #959595 inset; /* Opera 10.5, IE9 */
border: 1px solid grey;
color: #00769B;
font-size: 1.1em;
text-align: center;}
html
<table id="whitePanel" width="190px" cellpadding="0" cellspacing="0" border="0" >
<tr>
<td>ACTUAL CONTENT
<p>1. Item 1</p>
<p>1. Item 1</p>
<p>1. Item 1</p>
</td>
</tr>
</table>
Demo: http://jsbin.com/ebove4/3
Because internet explorer doesn't understand these css3 properties, you can use css3pie.
Try adding the following CSS style to your table...
#whitePanel {
border-collapse:collapse;
}
Ok, here is the code I used to solve the problem, I hope it helps all of you!
This method does not use Javascript, only CSS and HTML.
Result:
I still have some problems with the right corners ( top and bottom ) I hope to fix it soon.
Assets:
I'm sorry to put it like this but I don't have a development server right now.
b:
bl:
br:
c:
l:
r:
t:
tl:
tr:
Here is the HTML code ( DIVS ):
<div class="dialog">
<div class="hd">
<div class="c">
</div>
</div>
<div class="bd">
<div class="c">
<div class="s">
<!-- content area -->
<h3>a<b>developer</b>?</h3>
public <b>API</b> here!
<!-- content area -->
</div>
</div>
</div>
<div class="ft"><div class="c"></div></div>
</div>
And here the css code:
.dialog {
width:200px;
margin:10px 10px 0px 0px;
}
.dialog .hd .c,
.dialog .ft .c {
font-size:1px; /* ensure minimum height */
height:8px;
}
.dialog .ft .c {
height:8px;
}
.dialog .hd {
background:transparent url(../assets/images/lightRoundedCorners/tl.png) no-repeat ;
}
.dialog .hd .c {
background:transparent url(../assets/images/lightRoundedCorners/tr.png) no-repeat right 0px;
}
.dialog .bd {
background:transparent url(../assets/images/lightRoundedCorners/l.png) repeat-y 0px 0px;
}
.dialog .bd .c {
background:transparent url(../assets/images/lightRoundedCorners/r.png) repeat-y right 0px;
}
.dialog .bd .c .s {
margin:0px 8px 0px 8px;
background:transparent url(../assets/images/lightRoundedCorners/c.png) repeat 0px 0px;
padding:1px;
padding-left: 5px;
padding-bottom: 10px;
}
.dialog .ft {
background:transparent url(../assets/images/lightRoundedCorners/bl.png) no-repeat 0px 0px ;
}
.dialog .ft .c {
background:transparent url(../assets/images/lightRoundedCorners/br.png) no-repeat right 0px;
}
Hope it helps!
Related
I have a footer at the bottom of the page but when zooming in, the table in the middle of the screen grows but the footer doesn't. Is there any way, using basic HTML/CSS or any JS/CSS Framework that will allow me to continue it to grow.
.footer-center-vers2 {
position: relative;
background: #292929;
margin-left: 670px;
font-family: arial, Helvetica, sans-serif,verdana;
font-size: 9px;
color: #bfbfbf;
padding: 10px 0px 10px;
}
.Regulations {
padding: 0px 0px 0px 0px;
border-spacing: 0px;
margin: 0 auto;
width:1000px;
}
<table width="100%" class="Regulations">
<tr>
<td class="footer-center-vers2" style="text-align: center; vertical-align: middle;">
<span style="vertical-align: middle">
<img src="small.png" border="0" alt="My Company Ltd." /><br />
© My Insurance Company Text<br />
<br />
</span>
</td>
</tr>
</table>
At 0% Zoom, the table looks great but when you zoom in >125%, the table is no longer 100%. Any ideas, please?
Your table has the class .Regulations, for which you set a fixed width width:1000px;, which interferes with the width="100%" you set in the table tag in the HTML code. Remove one of the two.
Ok, so maybe I'm slightly losing my mind but I'm trying to recreate a homepage that incorporates 2 background images into my CSS. I'm attempting to use one as a top image and one as a bottom image, and in the middle is a table that has links and images. However, for some reason, I'm having difficulty with pulling it all together to make it look like one smooth image.
For example, my container class (as shown below) only puts a border around the topBox class and not the entire container div. I want all 3 divs to have one border around it (coming from the container class) so that it looks as if its one image. Here is my HTML and CSS.
What am I doing wrong? Thanks in advance for any assistance!
#Container {
float:left;
width: inherit;
height: 400px;
margin-left: auto;
margin-right: auto;
border:1px solid #000000;
}
.boxTop {
position: relative;
left: 100;
top: 100;
width: inherit;
height: 95px;
background-image: url(http://ejgh.org/templates/ejgh/images/HL_logo.jpg);
background-repeat: no-repeat;
/*place background image css code here and remove line above*/
background-position: left 0px top 0px;
background-size: 300px;
}
.box {
position: relative;
left: 100;
top: 100;
width: 350px;
height: 550px;
border:0px solid #000000;
}
.boxBtm {
position: relative;
left: 100;
top: 100;
width: inherit;
height: 95px;
background-image: url(http://ejgh.org/templates/ejgh/images/healthyLifestyles_bottom.gif);
/*place background image css code here and remove line above*/
background-repeat: no-repeat;
background-position: left 0px bottom 0px;
background-size: 300px;
}
<div id="Container">
<div class="boxTop"></div>
<div class="box"><table width="300px">
<tbody>
<tr>
<td>
<table cellspacing="0" cellpadding="6">
<tbody>
<tr>
<td valign="top"><img style="border-width: 0px;" src="http://ejgh.org/images/stories/template/healthylifestyles/apple.jpg" alt="Image of Apple and Weights for homepage" width="86" height="86" /></td>
<td valign="top">
<h3>Become a Member</h3>
<p>Join Healthy Lifestyles and enjoy the benefits of membership.</p>
</td>
</tr>
<tr>
<td valign="top"><img style="border-width: 0px;" src="http://ejgh.org/images/stories/template/healthylifestyles/elderlycouple.jpg" alt="Image of elderly couple at hospital in New Orleans Louisiana" width="86" height="83" /></td>
<td valign="top">
<h3>Classes & Support</h3>
<p>Learn more about the classes, support groups, and health screenings we offer.</p>
</td>
</tr>
<tr>
<td valign="top"><img style="border-width: 0px;" src="http://ejgh.org/images/stories/template/healthylifestyles/tvspot.jpg" alt="Image of Liz Delsa Healthy Lifestyles Host" width="86" height="70" /></td>
<td valign="top">
<h3>Watch the TV Segment</h3>
<p>Watch Healthy Lifestyles TV segments as seen on WWL-TV.</p>
</td>
</tr>
<tr>
<td valign="top"><img src="http://ejgh.org/images/stories/yourhealthimages/healthylifestyles/MagazineCovers/summer2016.jpg" alt="Summer 2016 Healthy Lifestyles Cover" width="86" height="100" /></td>
<td valign="top">
<h3>Read the Magazine</h3>
<p>Read the latest Healthy Lifestyles Magazine as included in the Times-Picayune newspaper.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table></div>
<div class="boxBtm"></div>
</div>
Very simple answer, just remove the hight of the id #Container and it'll work. I hope this is what you where looking for ;)
You have set a specific height on your container, so your border is only going to be that height. If you set the height to 750 pixels, it is going to work.
#Container {
float: left;
width: inherit;
height: 750px;
margin-left: auto;
margin-right: auto;
border: 1px solid #000000;
}
.boxTop {
position: relative;
left: 100;
top: 100;
width: inherit;
height: 95px;
background-image: url(http://ejgh.org/templates/ejgh/images/HL_logo.jpg);
background-repeat: no-repeat;
/*place background image css code here and remove line above*/
background-position: left 0px top 0px;
background-size: 300px;
}
.box {
position: relative;
left: 100;
top: 100;
width: 350px;
height: 550px;
border: 0px solid #000000;
}
.boxBtm {
position: relative;
left: 100;
top: 100;
width: inherit;
height: 95px;
background-image: url(http://ejgh.org/templates/ejgh/images/healthyLifestyles_bottom.gif);
/*place background image css code here and remove line above*/
background-repeat: no-repeat;
background-position: left 0px bottom 0px;
background-size: 300px;
}
<div id="Container">
<div class="boxTop"></div>
<div class="box">
<table width="300px">
<tbody>
<tr>
<td>
<table cellspacing="0" cellpadding="6">
<tbody>
<tr>
<td valign="top">
<a href="http://ejgh.org/your-health/healthy-lifestyles/become-a-member-sp-1672965733">
<img style="border-width: 0px;" src="http://ejgh.org/images/stories/template/healthylifestyles/apple.jpg" alt="Image of Apple and Weights for homepage" width="86" height="86" />
</a>
</td>
<td valign="top">
<h3>Become a Member</h3>
<p>Join Healthy Lifestyles and enjoy the benefits of membership.</p>
</td>
</tr>
<tr>
<td valign="top">
<a href="/component/wrapper/?Itemid=203">
<img style="border-width: 0px;" src="http://ejgh.org/images/stories/template/healthylifestyles/elderlycouple.jpg" alt="Image of elderly couple at hospital in New Orleans Louisiana" width="86" height="83" />
</a>
</td>
<td valign="top">
<h3>Classes & Support</h3>
<p>Learn more about the classes, support groups, and health screenings we offer.</p>
</td>
</tr>
<tr>
<td valign="top">
<a href="/component/hwdvideoshare/?task=viewcategory&Itemid=166&cat_id=5">
<img style="border-width: 0px;" src="http://ejgh.org/images/stories/template/healthylifestyles/tvspot.jpg" alt="Image of Liz Delsa Healthy Lifestyles Host" width="86" height="70" />
</a>
</td>
<td valign="top">
<h3>Watch the TV Segment</h3>
<p>Watch Healthy Lifestyles TV segments as seen on WWL-TV.</p>
</td>
</tr>
<tr>
<td valign="top">
<a href="/your-health/healthy-lifestyles/healthy-lifestyles-magazine">
<img src="http://ejgh.org/images/stories/yourhealthimages/healthylifestyles/MagazineCovers/summer2016.jpg" alt="Summer 2016 Healthy Lifestyles Cover" width="86" height="100" />
</a>
</td>
<td valign="top">
<h3>Read the Magazine</h3>
<p>Read the latest Healthy Lifestyles Magazine as included in the Times-Picayune newspaper.</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div class="boxBtm"></div>
</div>
This can be a lot simpler - you only need one wrapper div, not three. (You also shouldn't be using a table for layout purposes, but that's a whole other subject. For now, this'll work if you drop your table in where the content p tags are.)
Here's how to get roughly the visuals you want with a lot less code:
.box {
width: 300px;
border: 1px solid;
border-radius: 0 0 9px 9px;
/* You can specify multiple background images like this: */
background-image: url(http://ejgh.org/templates/ejgh/images/HL_logo.jpg), url(http://ejgh.org/templates/ejgh/images/healthyLifestyles_bottom.gif);
background-size: 100% auto;
background-repeat: no-repeat;
/* first position goes with the first image url and vice versa */
background-position: top, bottom;
/* 130px padding on top to create room for the "lifestyles" logo
20px on the sides for breathing room
50px at the bottom to create room for the green gradient
tweak these values till you like the spacing */
padding: 130px 20px 50px;
}
<div class="box">
<p>content</p>
<p>content</p>
<p>content</p>
</div>
When hovering over the image to prompt the text to appear, the text and banner flutter once you put the mouse over it. How can this be prevented.
Any help would be appreciated thanks.
Here's the sample. http://jsfiddle.net/a3mcmbby/
Html:
<div id="container-content">
<div id="design-background">
</div>
<div id="content">
<div id="table-content">
<table align="center">
<tbody>
<tr>
<td colspan="2" valign="bottom" style="font-family:ralewayregular; color: rgb(37,37,37); font-size: 110%; line-height: 150%;">
</td>
<td><img src="/images/layout/layoutImg6.png" alt="" width="310" height="182">
</td>
</tr>
<tr>
<td>
<img src="/images/layout/layoutImg4.jpg" alt="" width="304" height="194">
<h3>EXAMPLE</h3>
</td>
<td rowspan="2">
<img src="/images/layout/layoutImg5.jpg" alt="" width="311" height="406">
<h3>EXAMPLE</h3>
</td>
<td>
<img src="/images/layout/layoutImg1.jpg" alt="" width="308" height="195">
<h3>EXAMPLE</h3>
</td>
</tr>
<tr>
<td>
<img src="/images/layout/layoutImg3.jpg" alt="" width="304" height="195">
<h3>EXAMPLE</h3>
</td>
<td>
<img src="/images/layout/layoutImg2.jpg" alt="" width="308" height="195">
<h3>EXAMPLE</h3>
</td>
</tr>
<tr>
<td colspan="3" style="text-align:center; font-family: Semibold; color: rgb(165,97,11); font-size:300%;">Serving St. Catharines and Niagara Region</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
CSS:
#container-content{
position:relative;
margin: 0 auto;
width:100%;
min-height:700px;
background-color:#FFF;
}
#design-background{
position:absolute;
height:350px;
top:50%;
left:0px;
right:0px;
margin-top: -145px;
background: url('../images/background-dec.jpg');
}
#content{
position:relative;
margin: 0 auto;
left:0;
right:0;
width:980px;
}
#table-content{
position:absolute;
margin-top:-30px;
}
#table-content table tr td{
position: relative;
padding:8px;
}
#table-content table tr td h3{
display:none;
}
#table-content table tr td a:hover + h3{
color:#FFF;
display:block;
position: absolute;
z-index:10;
margin: auto;
top:0;
bottom:0;
left:8px;
right:10px;
font-family: ralewayregular;
height:50px;
background-color: rgba(0,0,0,0.7);
text-align: center;
padding-top:25px;
font-size: 200%;
}
http://jsfiddle.net/a3mcmbby/
try this
#table-content table tr td:hover h3{ #do something ... }
In your HTML, nest h3 within a, then adjust your CSS accordingly.
As it is now, h3 is being placed over top of the a tag when the a tag is hovered over. This prevents hovering from working so the hover status is removed. Then, it picks up the cursor hovering again because it is no longer covered - continuing in an endless loop.
When you display the h3, it is intercepting the hover in the underlying element, so it is no longer hovered. Then h3 is not displayed, the underlying element is hovered again , and so on
set
#table-content table tr td h3 {
pointer-events: none;
}
to avoid it
fiddle
My IFrame doesn't fill the cell in Explorer but does in Chrome. What gives? To fix in Explorer I have to hard code px the height and width. Any ideas why this is happening?
<style type="text/css">
.styleTbl
{
margin-bottom:10%;
margin-left:10%;
width:80%;
}
.styleBg
{
background: #00aced;
}
.style_logo
{
width:80%;
margin-left:10%;
}
.styleObj img
{
width: 100%;
}
iframe
{
background-color:#ffffff;
border-color:#eee9e9 ;
border-width:4px;
height: 99%;
width:99%;
margin:1px;
}
</style>
</head>
<body class="styleBg" onLoad="GetNewsSource()">
<table class="style_logo">
<tr>
<td>
<img alt="logo_banner Missing" class="style_logo" longdesc="Banner" src="logo_banner1.png" align="left"/>
</td>
<td>
<img alt="spinning_wheel" longdesc="Gif" src="Live.gif"style="height: 110px; width: 180px; " align="middle"/>
</td>
</tr>
</table>
<br />
<table class="styleTbl">
<tr>
<td height="100%" width="50%" rowspan="2">
<iFrame src="index.html"scrolling="no"></iFrame></td>
<td class="styleObj">
<img alt="png1" class="styleObj" longdesc="png1" src="png1.png"/></td>
</tr>
<tr class="styleRow">
<td class="styleObj">
<img alt="png2" class="styleObj" longdesc="png2" src="png2.png"/></td>
</tr>
<tr>
<td>
<img alt="png3" width=100% longdesc="png3" src="sentiment.png"/></td>
<td class="styleObj">
<img alt="png3" class="styleObj" longdesc="png3" src="png3.png"/></td>
</tr>
</table>
</body>
</html>
The issue is with using both percentages and pixel measurements for your iframe. Let's say you have a container width of 1000px. 99% of this is 990px, however applying a 1px margin to this results in a total internal width of 992px, leaving 8px for white space.
If you wanted to code this so no gaps would show, you should use a percentage for the margin also; 0.5% would return 4px for both sides in this example, leaving 0px of white space.
I suggest changing IFrame styling code to:
iframe
{
background-color:#ffffff;
border-color:#eee9e9 ;
border-width:4px;
height: 99%;
width:99%;
margin:0.5%;
}
I need to center-fit a background image in a HTML Table row <tr>, the size of the image is 40px height and 10px width. Also I need to put a border around the background image, same with border:2px solid #cccccc;
The HTML is generated from Javascript so changes must be in CSS.
Here is how it looks:
Rendered part of the page:
http://snag.gy/4EYin.jpg
Generated HTML:
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" style="vertical-align: top;">
<ul class="mystyle">
<li>
</li>
</ul>
</td>
</tr>
<tr>
<td align="left" style="vertical-align: top;">
<ul class="mystyle" style="padding-top: 0px; padding-bottom: 0px;">
<li>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
CSS:
.mystyle {
border:2px solid #cccccc;
background: url(../images/bar.png) no-repeat center left;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffe732', endColorstr='#ffffff',GradientType=1 ); /* IE6-8 */
width: 247px;
}
Update:
The current image is almost good only that it have some unwanted "spaces" top and bottom.
<style>
.mystyle {
border:2px solid #cccccc;
background: url(bar.png) no-repeat center left;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffe732', endColorstr='#ffffff',GradientType=1 ); /* IE6-8 */
width: 247px;
background-position:center;
}
</style>