December 6, 201114 yr I'm trying to add a table header background image, but when I try it makes the background image I'm trying to use constrained to each <th> even though I've put the css at the whole <tr>. How can I make it one big image and not stop and start?
December 6, 201114 yr Try this: <th style="background-image:url("YOUR_URL");"> If you could post the source code it would have helped Edited December 6, 201114 yr by Design Fan
December 6, 201114 yr Author Hmmm nope. :/ HTML: <!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" /> <link rel="stylesheet" type="text/css" href="../css/style.css"/> <title>Amesbury Cricket Club - News</title> </head> <body> <div class="top_bar"> <div class="logo"></div> </div> <div class="nav_bar"> <ul class="buttons"> <li><a href="../index.html"/><h1>HOME</h1></a></li> <li><a href="../results/index.html"/><h1>RESULTS</h1></a></li> <li><a href="../news/index.html"/><h1>NEWS</h1></a></li> <li><a href="../profiles/index.html"/><h1>PROFILES</h1></a></li> <li><a href="../committee/index.html"/><h1>COMMITTEE</h1></a></li> <li><a href="../media/index.html"/><h1>MEDIA</h1></a></li> <li><a href="../contact/index.html"/><h1>CONTACT</h1></a></li> <li><a href="../sponsors/index.html"/><h1>SPONSORS</h1></a></li> </ul> </div> <div class="news_main_content"> <div class="header"> <h1 class="committee">Committee Members</h1> <div class="breaker"></div> <p>Below you can find all of the committee memebers linked to Amesbury Cricket Club.</p> </div> <br /> <br /> <div class="committee_table"> <table> <tr class="top"> <th>Name</th> <th>Position Held</th> <th>Contact</th> </tr> <tr> <td>Kim Jenkins</td> <td>Chairman</td> <td>No Contact</td> </tr> <tr> <td>Tony Gower MBA</td> <td>Vice Chairman</td> <td>07739764149<br />tgandlg@ntlworld.com</td> </tr> <tr> <td>Martin Smith</td> <td>Secretary</td> <td>07703731240<br />bastoad@hotmail.com</td> </tr> <tr> <td>Paul Glover</td> <td>Treasurer and Senior Player</td> <td>No Contact</td> </tr> <tr> <td>Dale Gower</td> <td>Club and Saturday Captain</td> <td>07917549499<br />dale_gower@hotmail.com</td> </tr> <tr> <td>Andy Milnes</td> <td>Saturday Vice Captain</td> <td>07843624629</td> </tr> <tr> <td>Sam Dando</td> <td>Wednesday Captain</td> <td>No Contact</td> </tr> <tr> <td>Louie Hancock</td> <td>Wednesday Vice Captain</td> <td>No Contact</td> </tr> <tr> <td>Sam Macaulay</td> <td>Welfare Officer and Scorer</td> <td>No Contact</td> </tr> <tr> <td>Adie Berry</td> <td>Coach</td> <td>No Contact</td> </tr> <tr> <td>Brian White</td> <td>Groundsman</td> <td>No Contact</td> </tr> </table> </div> </div> </body> </html> CSS: body { background:url(../images/bg.jpg) repeat; font-family:Arial, Helvetica, sans-serif; } a { color:#3f74fb; text-decoration:none; border:0px; } a:hover { font-weight:bold; } .top_bar { background:url(../images/top_bar.png) no-repeat; width:948px; height:122px; position:absolute; top:0px; left:167px; } .top_bar .logo { background:url(../images/logo.png) no-repeat; width:315px; height:106px; position:absolute; top:10px; left:30px; } .nav_bar { background:url(../images/nav_bar.png) no-repeat; width:924px; height:53px; position:absolute; top:122px; left:178px; } .nav_bar ul.buttons { position:absolute; left:20px; top:-15px; float:right; text-align:right; width:auto; list-style: none; } .nav_bar ul.buttons li { float:left; width:auto; padding-right:15px; } .nav_bar ul.buttons li a{ display:block; float:left; font-weight:bold; color:#FFF; text-decoration:none; font-size:10px; } .nav_bar ul.buttons li a:hover{ color:#3f74fb; } .slider { background:url(../images/slider_bg.png) no-repeat; width:487px; height:301px; position:absolute; top:191px; left:165px; } .main_view { position: relative; } .window { height:301px; width:487px; overflow: hidden; position: relative; } .image_reel { position: absolute; top: 0; left: 0; } .image_reel img { float: left; } /*--Paging Styles--*/ .paging { position: absolute; z-index: 100; width:118px; height:279px; } .paging a { background:url(../images/slider_tab.png) no-repeat; width:118px; height:93px; padding-top:30px; padding-left:8px; text-align:center; color:#FFF; font-size:12px; } .paging a.page1 { width:118px; height:93px; position:absolute; top:-290px; left:470px; } .paging a.page2 { width:118px; height:93px; position:absolute; top:-197px; left:470px; } .paging a.page3 { width:118px; height:93px; position:absolute; top:-104px; left:470px; } .paging a.active { background:url(../images/slider_tab_active.png) no-repeat; width:118px; height:93px; } .paging a:hover { font-weight: bold; } .home_main_content { background:url(../images/home_main_content_bg.png) no-repeat; width:946px; height:461px; position:absolute; top:510px; left:168px; padding-bottom:50px; } .home_main_content h1 { color:#3f74fb; text-shadow: 0px 0px 10px #000; position:absolute; left:180px; font-weight:bolder; } .home_main_content .breaker { background:url(../images/breaker.png) no-repeat; width:825px; height:10px; position:absolute; left:50px; top:65px; } .home_main_content p { color:#FFF; width:896px; position:absolute; left:20px; top:70px; text-align:center; text-shadow: 0px 0px 5px #000; } .results_main_content { background:url(../images/results_main_content_bg.png) no-repeat; width:946px; height:572px; position:absolute; top:183px; left:167px; } .results_main_content h1 { color:#3f74fb; text-shadow: 0px 0px 10px #000; position:absolute; left:400px; font-weight:bolder; } .results_main_content .breaker { background:url(../images/breaker.png) no-repeat; width:825px; height:10px; position:absolute; left:50px; top:65px; } .results_main_content p { color:#FFF; width:896px; position:absolute; left:20px; top:70px; text-align:center; text-shadow: 0px 0px 5px #000; } .results_main_content #accordion { width:662px; position:absolute; top:65px; left:154px; } .results_main_content #accordion h3 { background:url(../images/accordian_tab.png) no-repeat; width:662px; height:46px; padding-left:30px; padding-top:10px; } .results_main_content #accordion .content { width:662px; height: 229px; background:url(../images/accordian_content.png) no-repeat; position:relative; top:-32px; } .news_main_content { background:url(../images/news_main_content_bg.png) no-repeat; width:946px; height:797px; position:absolute; top:183px; left:167px; padding-bottom:50px; } .news_main_content h1 { color:#3f74fb; text-shadow: 0px 0px 10px #000; position:absolute; left:400px; font-weight:bolder; } .news_main_content .breaker { background:url(../images/breaker.png) no-repeat; width:825px; height:10px; position:absolute; left:50px; top:65px; } .news_main_content .header p { color:#FFF; width:896px; text-align:center; text-shadow: 0px 0px 5px #000; position:absolute; top:70px; } .news_main_content p { color:#FFF; width:666px; text-align:left; text-shadow: 0px 0px 5px #000; } .news_main_content h2 { color:#FFF; font-size:12px; width:666px; text-align:left; text-shadow: 0px 0px 5px #000; } .news_main_content .news_breaker01 { background:url(../images/news_breaker.png) no-repeat; width:666px; height:10px; position:absolute; left:50px; top:154px; } .news_main_content .news_content01 h2 { position:absolute; left:55px; top:130px; } .news_main_content .news_content01 p { position:absolute; left:55px; top:150px; } .news_main_content .news_breaker02 { background:url(../images/news_breaker.png) no-repeat; width:666px; height:10px; position:absolute; left:50px; top:354px; } .news_main_content .news_content02 h2 { position:absolute; left:55px; top:330px; } .news_main_content .news_content02 p { position:absolute; left:55px; top:350px; } .news_main_content .news_breaker03 { background:url(../images/news_breaker.png) no-repeat; width:666px; height:10px; position:absolute; left:50px; top:554px; } .news_main_content .news_content03 h2 { position:absolute; left:55px; top:530px; } .news_main_content .news_content03 p { position:absolute; left:55px; top:550px; } .news_main_content .news_picture01 { background:url(../images/news_image_1.png) no-repeat; width:200px; height:135px; position:absolute; left:730px; top:180px; } .news_main_content .news_picture02 { background:url(../images/news_image_2.png) no-repeat; width:200px; height:135px; position:absolute; left:730px; top:380px; } .news_main_content .news_picture03 { background:url(../images/news_image_3.png) no-repeat; width:200px; height:135px; position:absolute; left:730px; top:580px; } .committee_table table { color:#FFF; position:relative; left:180px; top:50px; text-align:center; color:#FFF; font-size:14px; } .committee_table table th{ font-size:30px; font-weight:bolder; color:#3f74fb; padding:10px; padding-right:50px; padding-bottom:20px; } .news_main_content h1.committee { position:relative; left:300px; } form { position:relative; top:100px; left:-45px; float:left; } .myform{ margin:0 auto; width:400px; padding:14px; } #stylized label{ display:block; font-weight:bold; text-align:right; width:140px; float:left; color:#FFF; } #stylized input{ float:left; font-size:12px; padding:4px 2px; border:solid 1px #000; width:200px; margin:2px 0 20px 10px; } #stylized textarea{ float:left; font-size:12px; padding:4px 2px; border:solid 1px #000; width:200px; margin:2px 0 20px 10px; } button { position:absolute; top:210px; left:210px; font-size:18px; font-weight:bold; background-color:#FFF; border:1px solid #000; }
December 6, 201114 yr You've got <tr class="top"> but I can't see a style for it. If you add the background to the tr tag it shouldn't stop and start, it should continue across all th tags:- .top { background: url(images.jpg); } I've just tested.
December 6, 201114 yr Author You've got <tr class="top"> but I can't see a style for it. If you add the background to the tr tag it shouldn't stop and start, it should continue across all th tags:- .top { background: url(images.jpg); } I've just tested. Hmmm, not working for me still. :/ Could it be chrome?
December 6, 201114 yr .top { background:url(../images/IMAGENAME.EXT) no-repeat; } I guess this is what you should add, just change the inage name with extension to the original file name. Edited December 6, 201114 yr by Design Fan
December 8, 201114 yr Do you have a live link?? Or just upload all the folders and files in a zip file.
December 8, 201114 yr *delete please double post by mistake* Edited December 8, 201114 yr by D.Schuster
December 8, 201114 yr So you want to have a background image in the header that will stretch automatically thro the whole container depending on resolution? HTML <div class="headercontainer"> [indent]<div class="content"></div>[/indent] </div CSS .headercontainer{ background:url(../path/to/img) no repeat; -moz-background-size:cover; background-size:cover; -o-background-size:cover; -webkit-background-size:cover; width:enter widh of header; height:enter height of header; } Word of advice don't use tables as containers, they are horrible, no wait don't use tables for any layout elements at all. Edited December 8, 201114 yr by D.Schuster
Create an account or sign in to comment