I have been trying to fix the overlapping of the text in the the li when zooming in but i am unable to find a solution here is the link to JSFiddle.
if anyone is able to help me i will be gladly appreciated.
What I've updated:
moved hyperlinks inside listItems
removed float:right inside cells
added min-width to first cell of every column
removed width attribute to seconds cells
CSS
a {
text-decoration: none;
}
table {
display: inline-block;
line-height: 10px;
padding: 0px;
margin: 0px;
vertical-align: middle;
}
td {
height: 20px;
}
ul {
padding: 0px;
min-width: 700px;
margin: 0px;
overflow: hidden;
}
img {
vertical-align: middle;
margin-left: 5px;
}
#main_forums li:hover {
background: #EEE;
border: 1px solid #EEE;
border-radius: 4px;
}
#main_forums .main_forum_container li {
border: 1px solid #FFF;
clear: both;
border-radius: 4px;
display: block;
min-height: 50px;
height: 50px;
min-width: 900px;
padding-bottom: 10px;
}
#main_forums {
}
.sub_description {
min-width:300px;
}
#main_forums .main_forum {
background: #880000;
margin-top: 10px;
border: 1px solid #800;
border-radius: 4px;
}
.main_forum_header {
color: #FFF;
font-size: 20px;
font-weight: bold;
}
.main_forum_container {
background: #FFF;
color: #800;
border: 4px solid #800;
padding: 10px;
}
HTML
<div id="main_forums">
<div class="main_forum">
<div class="main_forum_header">
<img src="images/programming.png" height="70" width="70">
<span class="main_forum_title">Programming</span>
</div>
<div class="main_forum_container">
<ul>
<li>
<a href="?p=forums&forum_id=2&sub_id=1">
<img src="images/php.png" height="60" width="60">
<table border="1">
<tbody>
<tr>
<td class="sub_description" >
<span>PHP - Web Programming</span>
</td>
<td style="margin-right: 0px;">Posts: 12011</td>
</tr>
<tr>
<td class="sub_description" style="font-size: 12px;" >PHP web applications.</td>
<td>Views: 12012311</td>
</tr>
</tbody>
</table>
</a>
</li>
<li>
<a href="?p=forums&forum_id=2&sub_id=2">
<img src="images/python.png" height="60" width="60" />
<table>
<tbody>
<tr>
<td class="sub_description" >
<span>Python - Application Programming</span>
</td>
<td style="margin-right: 0px;">Posts: 12011</td>
</tr>
<tr>
<td class="sub_description" style="font-size: 12px;" >Python Application programming</td>
<td>Views: 12012311</td>
</tr>
</tbody>
</table>
</a>
</li>
</ul>
</div>
</div>
<div class="main_forum">
<div class="main_forum_header">
<img src="images/web_developing.png" height="70" width="70" />
<span class="main_forum_title">Web Developing</span>
</div>
<div class="main_forum_container">
<ul>
<li>
<a href="?p=forums&forum_id=1&sub_id=4">
<img src="images/css.png" height="60" width="60" />
<table>
<tbody>
<tr>
<td class="sub_description">
<span>CSS</span>
</td>
<td style="margin-right: 0px;">Posts: 12011
</td>
</tr>
<tr>
<td class="sub_description" style="font-size: 12px;" >Cascading Style Sheets</td>
<td>Views: 12012311</td>
</tr>
</tbody>
</table>
</a>
</li>
<li>
<a href="?p=forums&forum_id=1&sub_id=3">
<img src="images/html.png" height="60" width="60" />
<table>
<tbody>
<tr>
<td class="sub_description">
<span>HTML</span>
</td>
<td style="margin-right: 0px;">Posts: 12011</td>
</tr>
<tr>
<td class="sub_description" style="font-size: 12px;" >HyperText Markup Language</td>
<td>Views: 12012311</td>
</tr>
</tbody>
</table>
</a>
</li>
</ul>
</div>
</div>
</div>
Is there a reason for the tables? The first thing I would do is remove the tables. In fact none of your HTML is semantic. You have tables inside of li tags and li tags surrounded by hyperlinks.
<ul>
<li>
<a href="?p=forums&forum_id=2&sub_id=1">
<img src="images/php.png" height="60" width="60">
<span>PHP - Web Programming</span>
Posts: 12011
PHP web applications.
Views: 12012311
</a>
</li>
<li>
<a href="?p=forums&forum_id=2&sub_id=2">
<img src="images/python.png" height="60" width="60">
<span>Python - Application Programming</span>
Posts: 12011
Python Application programming
Views: 12012311
</a>
</li>
</ul>
http://jsfiddle.net/pLy92/
See how that already cleans things up? These are all in-line elements so they line up.
Remove the slash() in that <a href="?p=forums&forum_id=1&sub_id=4">\
Related
I have no basic clue about html and and right now am kinda stuck, I need two images side by side around the bottom half part of a email template, thing is no matter what I do I can't get the image to be side by side. there is already a hero image on the email template I am not sure if that's what causing the error. Can you please help me with this or give me some learning metrials so that I can figure this out.
Can you please help me with this or give me some learning metrials so that I can figure this out.
PS: Please don't mind the rickroll video, I added it to replace the link
The below code is how the banner hero image is setup
<tr>
<td class="hero" style="border-collapse: collapse; border-spacing: 0px; margin: 0px; padding: 0px;" align="center" valign="top">
<a title="placeholdertext" href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank" rel="noopener">
<img class="fr-dib" style="width: 620px; max-width: 560px; color: #000000; font-size: 13px; padding: 0px; outline: currentcolor none medium; text-decoration: none;" title="rick roll" src="test_mail_f.jpg" alt="rick roll" width="560" height="349" border="0" />
</a>
</td>
</tr>
Use a <table>, it should be compatible with Outlook email client as well. For more on HTML email see this article.
<table>
<tr>
<td>
<a href="#">
<img src="https://placem.at/places?w=160&h=90&random=1&txt=1&txtclr=fc0">
</a>
</td>
<td>
<a href="#">
<img src="https://placem.at/places?w=160&h=90&random=1&txt=2&txtclr=fc0">
</a>
</td>
</tr>
</table>
You can do it by several ways. The easiest is use another table in td with two columns, like this:
<tr>
<td class="hero" style="border-collapse: collapse; border-spacing: 0px; margin: 0px; padding: 0px;" align="center" valign="top">
<a title="placeholdertext" href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank" rel="noopener">
<img class="fr-dib" style="width: 620px; max-width: 560px; color: #000000; font-size: 13px; padding: 0px; outline: currentcolor none medium; text-decoration: none;" title="rick roll" src="test_mail_f.jpg" alt="rick roll" width="560" height="349" border="0" />
</a>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
<a href="#">
<img src="#">
</a>
</td>
<td>
<a href="#">
<img src="#">
</a>
</td>
</tr>
</table>
</td>
</tr>
Don't forget to let me know if it works for you or not.
I would recommend using the display: flex; property, which automatically makes the flow of the content inside a container to a row.
<div style="display: flex;">
<img src="example.com" />
<img src="example.com" />
</div>
I checked some of the posts here regarding conversion from html table to css but can't find what I am looking and hoping for some help.
I am using a table as a graphical presentation of some lockers that have different sizes. As a result, some table cells span multiple rows. All was fine when there were a few static models. Now I have to deal with dynamic configurations and tables are just a pain, so I am trying to convert it to CSS.
I am running into some problems when cell spans multiple rows and not sure how to set up the CSS. I need to see how it is done statically before attempting to generate the code dynamically.
Here is a short sample:
<table>
<tr>
<td id="Td7" rowspan="4" height="100">R0C0</td>
<td id="Td8" height="25" >R0C1</td>
<td id="Td9" height="25" >R0C2</td>
</tr>
<tr>
<td id="Td10" height="25" >R1C1</td>
<td id="Td11" height="25" >R1C2</td>
</tr>
<tr>
<td id="Td12" height="25" >R2C1</td>
<td id="Td13" height="25" >R2C2</td>
</tr>
<tr>
<td id="Td14" height="25" >R3C1</td>
<td id="Td15" height="25" >R3C2</td>
</tr>
</table>
CSS (Attempt), can get the first row but not sure how to do the rest:
<div>
<span style="display:inline-block;width:100px;height:100px;border:solid 1px black;vertical-align:top;">R0C0</span>
<span style="display:inline-block;width:100px;height:25px;border:solid 1px black;vertical-align:top;">R0C1</span>
<span style="display:inline-block;width:100px;height:25px;border:solid 1px black;vertical-align:top;">R0C2</span>
</div>
Also tried css "table", using the code in one of the posts here:
<style type="text/css">
.css-table {
display: table;
background-color:#ccc;
width: 350px;
}
.css-table-tr {
display: table-row;
}
.css-table-td_small {
display: table-cell;
border:1px solid black;
width: 100px;
height:25px;
display:inline-blok;
text-align:center;
vertical-align:top;
}
.css-table-td_medium {
display: table-cell;
border:1px solid black;
width: 100px;
height:50px;
display:inline-blok;
text-align:center;
vertical-align:top;
}
.css-table-td_large {
display: table-cell;
border:1px solid black;
width: 100px;
height:100px;
display:inline-blok;
text-align:center;
vertical-align:top;
}
.css-table-td_kiosk {
display: table-cell;
border:1px solid black;
width: 100px;
height:150px;
display:inline-blok;
text-align:center;
vertical-align:top;
}
</style>
<div class="css-table">
<div class="css-table-tr">
<span class="css-table-td_kiosk">R0C0</span>
<span class="css-table-td_small">R0C1</span>
<span class="css-table-td_small">R0C2</span>
</div>
</div>
Edit:
This is the (sample) table I need I need to convert. The position and size of lockers will change depending on the model. If I can figure out what one model would look like using CSS, I can work it out to make it dynamic. L, M and S in parenthesis imply locker size. Medium is 2 times small, large is 4 times small and Kiosk is 6 times small locker size.
<table border="1" style="width:600px">
<tr>
<td id="Td1" height="100" >K01D04 (L)</td>
<td id="Td2" height="100" >C02D08 (L)</td>
<td id="Td3" height="100" >C03D08 (L)</td>
</tr>
<tr>
<td id="Td4" height="25" >K01D03 (S)</td>
<td id="Td5" height="25" >C02D07 (S)</td>
<td id="Td6" height="25" >C03D07 (S)</td>
</tr>
<tr>
<td id="Td7" rowspan="5" height="150" class="kPL_Kiosk">KIOSK</td>
<td id="Td8" height="25" >C02D06 (S)</td>
<td id="Td9" height="25" >C03D06(S)</td>
</tr>
<tr>
<td id="Td10" height="25" >C02D05 (S)</td>
<td id="Td11" height="25" >C03D05 (S)</td>
</tr>
<tr>
<td id="Td12" height="25" >C02D04 (S)</td>
<td id="Td13" height="25" >C03D04 (S)</td>
</tr>
<tr>
<td id="Td14" height="25" >C02D03 (S)</td>
<td id="Td15" height="25" >C03D03 (S)</td>
</tr>
<tr>
<td id="Td16" height="50" >C02D02 (M)</td>
<td id="Td17" height="50" >C03D02 (M)</td>
</tr>
<tr>
<td id="Td18" height="50" >K01D02 (M)</td>
<td id="Td19" rowspan="2" height="100" >C02D01 (L)</td>
<td id="Td20" rowspan="2" height="100" >C03D01 (L)</td>
</tr>
<tr>
<td id="Td21" height="50">K01D01 (M)</td>
</tr>
</table>
Thanks.
Edit 2:
The image below shows what I need to display (one variation). L: large locker, height 100 px, M: medium, height 50 px; S: small; height 25 px. However, I do not seem to be able to get the lockers to display column-wise even though I specify flex-direction: column.
Edit 3:
This is the CSS and HTML I am using. Once I added width and height to flex-direction, it started to display the images column-wise. I guess this is an undocumented requirement. However, now everything is displayed in column. This is what I have:
.lockers {
display: flex;
-webkit-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap:wrap;
flex-wrap:wrap;
-webkit-justify-content: space-around;
justify-content: space-around;
align-items: flex-start;
}
.locker-column {
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
-webkit-flex-wrap:wrap;
flex-wrap:wrap;
-webkit-align-items: flex-start;
align-items: flex-start;
height:420px;
width:100px;
}
img {
display: flex;
max-width: 100px;
height: auto;
-webkit-flex-grow:1;
flex-grow:1;
}
<div class="lockers">
<div class="locker-column">
<img src="..\assets\images\Lockers\L.png" title="R1C1-L" />
<img src="..\assets\images\Lockers\S.png" title="R2C1-S" />
<img src="..\assets\images\Lockers\Kiosk.png" title="Kiosk" />
<img src="..\assets\images\Lockers\M.png" title="R4C1-M" />
<img src="..\assets\images\Lockers\M.png" title="R5C1-M" />
</div>
<div class="locker-column">
<img src="..\assets\images\Lockers\L.png" title="R1C2-L" />
<img src="..\assets\images\Lockers\S.png" title="R2C2-S" />
<img src="..\assets\images\Lockers\S.png" title="R2C3-S" />
<img src="..\assets\images\Lockers\S.png" title="R2C4-S" />
<img src="..\assets\images\Lockers\S.png" title="R2C5-S" />
<img src="..\assets\images\Lockers\S.png" title="R2C6-S" />
<img src="..\assets\images\Lockers\M.png" title="R2C7-M" />
<img src="..\assets\images\Lockers\L.png" title="R2C8-L" />
</div>
<div class="locker-column">
<img src="..\assets\images\Lockers\L.png" title="R1C3-L" />
<img src="..\assets\images\Lockers\S.png" title="R2C3-S" />
<img src="..\assets\images\Lockers\S.png" title="R3C3-S" />
<img src="..\assets\images\Lockers\S.png" title="R4C3-S" />
<img src="..\assets\images\Lockers\S.png" title="R5C3-S" />
<img src="..\assets\images\Lockers\S.png" title="R6C3-S" />
<img src="..\assets\images\Lockers\M.png" title="R7C3-M" />
<img src="..\assets\images\Lockers\L.png" title="R8C3-L" />
</div>
</div>
Edit 4:
Don't use display: table. Is this what you're looking for?
Edit: Elaboration
I don't think you're grasping the concept..
I'll try to explain to you how you should be thinking about this. Usually with tables, you're thinking in terms of rows, where that might be the case with flexboxes, when I wrote my solution I was thinking about it in terms of columns.
Notice how I have flex-direction: column on the children of lockers? This div literally spans the entire column, from top to bottom. You can do whatever you want, put whatever lockers you want, of whatever size.
If you have absolutely no experience with flexboxes I recommend you read up on it, but the solution below gives you a core foundation to what you are trying to do.
This tutorial is a good starting point.
.lockers {
display: flex;
justify-content: space-around;
align-items: flex-start;
}
.locker-column {
display: flex;
flex-direction: column;
align-items: stretch;
width: 100px;
}
.locker {
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
text-decoration: underline;
font-weight: 600;
text-transform: uppercase;
margin: 2px 0;
height: 100%;
}
.large {
background-color: yellow;
color: red;
height: 100px;
}
.small {
background-color: navy;
color: white;
height: 25px;
}
.medium {
background-color: green;
color: red;
height: 50px;
}
.kiosk {
color: red;
text-decoration: none;
text-transform: lowercase;
height: 150px;
}
<div class="lockers">
<div class="locker-column">
<div class="large locker">L11</div>
<div class="small locker">S21</div>
<div class="kiosk locker">Kiosk</div>
<div class="medium locker">M81</div>
<div class="medium locker">M91</div>
</div>
<div class="locker-column">
<div class="large locker">L12</div>
<div class="small locker">S22</div>
<div class="small locker">S32</div>
<div class="small locker">S42</div>
<div class="small locker">S52</div>
<div class="small locker">S62</div>
<div class="medium locker">M72</div>
<div class="large locker">M82</div>
</div>
<div class="locker-column">
<div class="large locker">L13</div>
<div class="small locker">S23</div>
<div class="small locker">S33</div>
<div class="small locker">S43</div>
<div class="small locker">S53</div>
<div class="small locker">S63</div>
<div class="medium locker">M73</div>
<div class="large locker">M83</div>
</div>
</div>
I know that many people ask this question, but I can't make my website work. When I zoom every div go one under the other. I post only a little part of my html css cause the problem comes also with two div.
body {
margin: 0;
font-family: Sans-Serif;
background-image: url("pictures/backgroundbody.png");
background-repeat: repeat-x;
}
p {
display: inline;
}
a {
text-decoration: none;
}
#page {
margin: 0 auto;
}
#header{
height: 11.937em;
width: 100%;
margin-top: 0.812em;
}
#titlebar {
height: 6.25em;
}
#giga_weather_and_search{
float: right;
margin-right: 15em;
font-size: 0.875em;
color: #5278ae;
text-align: right;
width: 27.875em;
height: 6em;
}
#weather_bar{
font-size: 0.857em;
float: right;
}
#weather_bar td{
padding-left: 0.357em;
padding-right: 0.357em;
}
.weather_table{
padding: 0.428em;
border-spacing: 0px;
border-collapse: separate;
}
#upper_search_bar{
float: right;
font-size: 0.857em;
}
.upper_search_table{
padding: 0.214em;
}
#upper_search_bar td{
padding-left: 0.143em;
padding-right: 0.143em;
}
#bottom_search_bar{
float: right;
font-size: 0.857em;
}
#bottom_search_bar td{
padding-left: 0.143em;
padding-right: 0.143em;
}
#logo_bar{
margin-left: 12em;
margin-top: 4.312em;
float: left;
width: 23.125em;
height: 2.375em;
}
#logo_bar img{
width: 23.125em;
height: 2.375em;
}
<head>
<title>
Colorado Breaking News, Sports, Wheather, Traffic - The Denver Post
</title>
<link rel="stylesheet" type="text/css" href="style1.css" />
<style type="text/css">
A:link, A:visited {text-decoration: none}
A:hover {text-decoration: underline}
</style>
</head>
<body>
<div id="page">
<div id="header">
<div id="titlebar">
<div id="giga_weather_and_search">
<div id="weather_bar">
<table class="weather_table">
<td style="white-space:nowrap">
<div class="weather">
Weather:
<img src="pictures/weather.png" alt="weather logo">
<p>Denver, CO</p>
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="now">
Now: 39°
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="high">
High: 49°
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="low">
Low: 49°
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="forecast">
5-Day Forecast
</div>
</td>
</table>
</div> <!--weather_bar-->
<div id="upper_search_bar">
<table class="upper_search_table">
<td style="white-space:nowrap">
<div class="newsletters">
Newsletter
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="subscribe">
Subscribe
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_weather_bar.png" alt="weather barretta">
</td>
<td style="white-space:nowrap">
<div class="member_services">
Member Services
</div>
</td>
</table>
</div> <!--upper_search_bar-->
<div id="search_bar">
<img src="pictures/search_bar.png" alt="search bar"/>
</div>
<div id="bottom_search_bar">
<table class="bottom_search_table">
<td style="white-space:nowrap">
<div class="autos">
Autos
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_bottom_search_bar2.png" alt="barretta bottom search bar">
</td>
<td style="white-space:nowrap">
<div class="real_estate">
Real Estate
</div>
</td>
<td style="white-space:nowrap">
<img src="pictures/barretta_bottom_search_bar2.png" alt="barretta bottom search bar">
</td>
<td style="white-space:nowrap">
<div class="jobs">
Jobs
</div>
</td>
</table>
</div> <!--bottom_search_bar-->
</div> <!--giga_weather_and_search-->
<div id="logo_bar">
<img src="pictures/logo_bar.png"/>
</div>
</div> <!--titlebar-->
</div> <!--header-->
</div> <!--page-->
</body>
I am currently learning HTML and CSS. My problem is: I have a button and a search bar with the search bar currently below the button. I have tried different solutions but to no avail. What should I do so that the button and the search bar are beside each other
Here is my code
<!DOCTYPE html>
<html>
<head>
<title>Sample Dashboard</title>
<style type="text/css">
table, th, td {
border: 1px solid black;
}
p.pos_right {
position: relative;
left: 20px;
}
img {
display: inline-block;
z-index:-1;
}
#mine{
display: inline;
}
</style>
</head>
<body>
<div style="text-align:center;">
<p>Most Number of Referrals for the month of <img src="Red-Ribbon.jpg" alt="redribbon" width="200" height="200" style="vertical-align:top"> </p>
</div>
<div class = "mine" align ="center">
<button style="background-color:yellow" onclick="window.location.reload()"><b>UPDATE</b></button>
<table class = "one" style=border="1" cellpadding="0px" cellspacing="0px">
<tr>
<td style="border-style:solid none solid solid;border-color:#4B7B9F;border-width:1px;">
<input type="text" name="zoom_query" style="width:100px; border:0px solid; height:17px; padding:0px 3px; position:relative;">
</td>
<td style="border-style:solid;border-color:#4B7B9F;border-width:1px;">
<input type="submit" value="" style="border-style: none; background: url('searchbutton3.gif') no-repeat; width: 24px; height: 20px;">
</td>
</tr>
</table>
</div>
</body>
</html>
use .mine not #mine (which is for ID.)
give display:inline-block for childer of mine
.mine>button,.mine>table{
display: inline-block;float:left;
}
table, th, td {
border: 1px solid black;
}
p.pos_right {
position: relative;
left: 20px;
}
img {
display: inline-block;
z-index:-1;
}
.mine>button,.mine>table{
display: inline-block;float:left;
}
refer below code snippet.
<div style="text-align:center;">
<p>Most Number of Referrals for the month of <img src="Red-Ribbon.jpg" alt="redribbon" width="200" height="200" style="vertical-align:top"> </p>
</div>
<div class = "mine" align ="center">
<button style="background-color:yellow" onclick="window.location.reload()"><b>UPDATE</b></button>
<table class = "one" style=border="1" cellpadding="0px" cellspacing="0px">
<tr>
<td style="border-style:solid none solid solid;border-color:#4B7B9F;border-width:1px;">
<input type="text" name="zoom_query" style="width:100px; border:0px solid; height:17px; padding:0px 3px; position:relative;">
</td>
<td style="border-style:solid;border-color:#4B7B9F;border-width:1px;">
<input type="submit" value="" style="border-style: none; background: url('searchbutton3.gif') no-repeat; width: 24px; height: 20px;">
</td>
</tr>
</table>
</div>
One of many ways to achieve this would be to put the button in its own
<td>
tag inside the row of the table. I.e.
<table class = "one" style=border="1" cellpadding="0px" cellspacing="0px">
<tr>
<td>
<button style="background-color:yellow" onclick="window.location.reload()"><b>UPDATE</b></button>
</td>
...
See https://jsfiddle.net/orndorffgrant/189judf0/
.
The reason that there was a line break is that there is an implicit line break before and after every table.
I Have 3 Images as icons for different use.
Now what I want is,
If the first icon is clicked, the first icon should be highlighted, if second is clicked the second icon should be highlighted.
Please see the HTML for your ref:-
<tr>
<td width="18%" height="40" align="left" valign="middle"></td>
<td style="text-align: left; vertical-align: middle;" width="6%">
<input type="checkbox" id="branchChkbx" title="Branch" checked="checked" class="hideChkbx" />
<a href="locateBranches_rbl_view.aspx" style="color: #666; font-family: 'signika_negativeRegular', sans-serif;">
<img alt="Branch" src="images/branch_icon.png" height="40" width="40" title="Branch" style="border: 0;" />
<p class="para01">Branch</p>
</a>
</td>
<td style="text-align: left; vertical-align: middle;" width="5%">
<input type="checkbox" id="atmChkbx" title="ATM" checked="checked" class="hideChkbx" />
<a href="locateATM_rbl.aspx" style="color: #666; font-family: 'signika_negativeRegular', sans-serif;">
<img alt="ATM" src="images/atm_icon.png" height="40" width="40" title="ATM" style="border: 0;" /><p class="para01">ATM</p>
</a>
</td>
<td style="text-align: left; vertical-align: middle;" width="6%">
<input type="checkbox" id="lockerChkbx" title="Locker" checked="checked" class="hideChkbx" />
<a href="locateLockers_rbl.aspx" style="color: #666; font-family: 'signika_negativeRegular', sans-serif;">
<img alt="Locker" src="images/locker_icon.png" height="40" width="40" title="Locker" style="border: 0;" /><p class="para01">Locker</p>
</a>
</td>
<td width="6%" height="40" align="left" valign="middle" style="border-left: 1px solid #cccccc;">
<a id="A1" href="Default.aspx" runat="server" style="float: left; text-decoration: underline; color: #666; margin-left: 12px; font-family: 'signika_negativeRegular', sans-serif;">
<p class="para01">View All</p>
</a>
</td>
</tr>
Also see the CSS:-
.para01 {
font-size: 16px;
margin-top: 6px;
font-weight: bold;
margin-top: 10px;
}
Please help
Your best option should be to make the images into css sprite, and change background-sizes. If that's hard for you, you can just make images background of the A tag. Like so:
a {
background: url('image.png') no-repeat center center;
}
a.highlighted {
background-image: url('image-highlight.png');
}
Did it like this
CSS
para01 {
font-size: 16px;
margin-top: 6px;
font-weight: bold;
/*line-height: 1.5em;*/
margin-top: 10px;
}
.highlight {
background: yellow;
}
.imghighlight{
height:50px;
width:50px;
}
JQuery:-
$(document).ready(function () {
$('input.hideChkbx').on('change', function () {
$('input.hideChkbx').not(this).prop('checked', false);
$('input.hideChkbx').not(this).parent().find("img").removeClass("imghighlight");
$('input.hideChkbx').not(this).parent().find(".para01").removeClass("highlight");
if ($(this).is(':checked')) {
$(this).parent().find("img").addClass("imghighlight");
$(this).parent().find(".para01").addClass("highlight");
}
});
});
And it worked