CSS is it possible to use element after :hover? - html

Is it possible to use element after hover effect
I tried like this
.tableclass tr td:hover a{
color:#fff;
}
what i am trying to do that when i hover the td so then anchor link inside that td should change its color to white..
here is how i tried my self but not working for me?
.GridAlternate td:hover a , .GridRowStyle td:hover a{
color:#fff;
}
My GridView HTML
<table cellspacing="0" border="1" style="border-collapse:collapse;" id="GV_Users" rules="rows" class="DefaultGridStyle">
<tbody><tr class="GridHeader">
<th scope="col">User Name</th><th scope="col">Role Name</th><th valign="middle" align="left" style="width:22%;" scope="col">LogIn</th><th valign="middle" align="center" style="width:33%;" scope="col">Action</th>
</tr><tr class="GridRowStyle">
<td>
Ali Nisarr
</td><td>
Admin
</td><td valign="middle" align="left">
alinisar#ken.com
</td><td valign="middle" align="center">
Edit
Remove
Disable
</td>
</tr><tr class="GridAlternate">
<td>
Nizam Ullah
</td><td>
Admin
</td><td valign="middle" align="left">
nizam#ken.com
</td><td valign="middle" align="center">
Edit
Remove
Disable
</td>
</tr><tr>
<td colspan="4">
<table class="GridPager">
<tbody><tr>
<td width="7%">
Showing
:
</td>
<td width="5%">
<span id="lbl_rowstartindex">1</span>
-
</td>
<td>
<span id="lbl_rowendindex">2</span>
</td>
<td>
of
</td>
<td>
<span id="lbl_totalrecords">2</span>
</td>
<td width="50%" align="center">
</td>
<td width="18%" align="right">
Displaying per page:
</td>
<td align="left">
<input type="text" id="TxBx_PageSize" maxlength="3" value="10" name="ctl00$CPH_Content$TC_SysUsers$TP_Users$GV_Users$ctl05$TxBx_PageSize">
</td>
<td align="left">
Change
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
Am i doing something wrong or is there any other approach i should follow?

try this;
tr.GridAlternate td:hover a , tr.GridRowStyle td:hover a{
color:#fff;
}
And make sure to insert this at the end of the style sheet. Maybe it is being override by other class.
I hope this helps

http://codepen.io/princemaple/pen/Dcxdi
It's totally working for me.
I assume some of your rules are wrongly cascaded?
Like you have more specific targeting rules overrides this rule...

Why dont you try
.tableclass td:hover a {
color:#fff;
}

Related

css background image not displaying in html table

i have added this style to a table
background-image:url(square_image.png); background-size:auto; background-repeat:no-repeat;
However the image is not being displayed in the background.
The demo Jsfiddle link here
This is because you're having two inline "style" attributes.
Your updated code should be like:
<table border="0" cellspacing="0" cellpadding="5" style="width:100%; min-width:500px; max-width:700px; font-family:Arial; font-size:14px;">
<tr>
<td><table width="240" height="300px" border="0" cellpadding="2" cellspacing="0" style="font-size:12px; font-family:Arial;background-image:url('https://s32.postimg.org/wi1c9sm3p/Integra_Icons_Square_on_orange.jpg'); background-size:auto; background-repeat:no-repeat;">
<tr>
<td align="right">Text</td>
<td align="right">Text</td>
</tr>
<tr>
<td align="right">Text</td>
<td align="right">Text</td>
</tr>
<tr>
<td align="right">Text</td>
<td align="right">Text</td>
</tr>
<tr>
<td align="right">Text</td>
<td align="right">Text</td>
</tr>
<tr>
<td align="right">Text</td>
<td align="right">Text</td>
</tr>
</table></td>
</tr>
</table>
Updated jsfiddle: https://jsfiddle.net/j03mp8bc/8/
It is not allowed to use multiple attributes in HTML.
Validate your HTML before asking on StackOverflow.
https://validator.w3.org/
https://jsfiddle.net/ou366bh7/
style=""

Merge several tables together

I'm trying to merge tables together by using colspan, but cant seem to create my table. How can i merge tables columns together like following:
The general layout would be:
table,
td {
border: 1px solid #000;
}
table {
width: 50%;
border-collapse: collapse;
}
<table>
<tr>
<td rowspan="2"> </td>
<td rowspan="2"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
Here is the solution
HTML code is here:
<table width="500" border="1" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="2"> </td>
<td rowspan="2"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
CSS code is here :
table,td {
border-collapse: collapse;
}
JS fiddle Link : http://jsfiddle.net/naveenkumarpg/543c3896/
if you need exact widths for td's you have to use class selector and adjust accordingly

How to add horizontal line in a table?

Following is the code of table :
<table cellpadding="0" cellspacing="" width="100%" border="0">
<tbody>
<tr class="pack_list_divider">
<td width="30%" rowspan="2">
<img id="coursimg" src="test_listings_files/default_package_image.png" alt="Section wise test" border="0">
</td>
<td width="25%">
<p class="pckgvalidity">
Validity : 1 Year
</p>
</td>
<td width="35%">
<p class="pckgvalidity">Number of Tests : 0
</p>
</td>
<td width="20%" valign="middle">
<!--<p id="test_list_loader" height="20" align="center" style="display:none;"></p> -->
Test Details
</td>
</tr>
<tr>
<td colspan="2" width="50%" valign="top">
<p class="descp">
sectionm wise tests
</p>
</td>
<td width="20%">
<p class="pckgrs"> <span class="rs fl" style="color:#333333; font:25px bold; margin:0px 0px 10px 10px;"> Free </span>
<span>
<a class="user-not-loggedin more addcart fl" href="http://localhost/entrance_prime/Entrance_Prime/entprm/web/my_cart.php?pack_id=21e86b3ebf6a8af2a9fcf136c4f8e88a&pack_type=test&op=aa" id="21e86b3ebf6a8af2a9fcf136c4f8e88a" value="21e86b3ebf6a8af2a9fcf136c4f8e88a" style="background:url(../images_new/add_account.png) 0 0 no-repeat;"> </a>
</span>
</p>
</td>
</tr>
</tbody>
</table>
I want a horizontal line in between the rows. I've tried so many tricks but none of them did the magic for me. How can this issue be resolved?
I use this trick:
<table>
<tr style="border-bottom:1px solid black">
<td colspan="100%"></td>
</tr>
<tr> ... </tr>
</table>
Use a Table Header and add the underline in there
table { border-collapse:collapse; }
table thead th { border-bottom: 1px solid #000; }
<table>
<thead>
<tr>
<th>Valididty></th>
<th>No Of Tests</th>
</tr>
</thead>
<tbody>
<tr>
<td>Test</td>
<td>Test</td>
</tr>
</tbody>
</table>
With CSS you can style the header row. Make each cell have a bottom border.
have a look here: http://jsfiddle.net/ZmBmh/
HTML
<table>
<tr class="firstLine">
<td>hey</td><td>hello</td><td>yuhuu</td>
</tr>
<tr>
<td>hey</td><td>hello</td><td>yuhuu</td>
</tr>
<tr>
<td colspan="3"><hr/></td>
</tr>
<tr>
<td>hey</td><td>hello</td><td>yuhuu</td>
</tr>
</table>
CSS
table{
border-collapse: collapse;
}
.firstLine td{
border-bottom: 2px solid black;
}
Something like this:
<table border="1" cellpadding="0" cellspacing="" width="100%">
<tbody>
<tr class="pack_list_divider">
<tr> </tr>
<td width="25%">
<p class="pckgvalidity">
Validity : 1 Year
</p>
</td>
<td width="35%">
<p class="pckgvalidity">Number of Tests : 0
</p>
</td>
<td width="20%" valign="middle">
<!--<p id="test_list_loader" height="20" align="center" style="display:none;"></p> -->
Test Details
</td>
</tr>
<tr>
<td colspan="2" width="50%" valign="top">
<p class="descp">
sectionm wise tests
</p>
</td>
<td width="20%">
<p class="pckgrs"> <span class="rs fl" style="color:#333333; font:25px bold; margin:0px 0px 10px 10px;"> Free </span>
<span>
<a class="user-not-loggedin more addcart fl" href="http://localhost/entrance_prime/Entrance_Prime/entprm/web/my_cart.php?pack_id=21e86b3ebf6a8af2a9fcf136c4f8e88a&pack_type=test&op=aa" id="21e86b3ebf6a8af2a9fcf136c4f8e88a" value="21e86b3ebf6a8af2a9fcf136c4f8e88a" style="background:url(../images_new/add_account.png) 0 0 no-repeat;"> </a>
</span>
</p>
</td>
</tr>
</tbody>
</table>
Tell me if that is what you're looking for.

Table's border-right doesn't show in email template when viewed in Outlook

I have gone through a lot of threads, but I couldn't find something helpful. If that's a duplicate please point me to the relevant thread.
We have created a custom RSS feed for one of our websites in order to achieve the design we wanted for the template. I have managed to make it look good almost everywhere expect Outlook, which is a pain!
The main problem I'm facing is that I cannot show the right border in one of my boxes.
Please refer to the attached screenshot.
Here's my HTML. I have also tried by using percentages for the widths, but didn't work either.
<table width="525" height="250" border="0" cellpadding="0" cellspacing="0" bgcolor="#fafafa" class="main-content" style="border:1px solid #ccc;">
<tr>
<td width="50"><!-- --></td>
<td width="284" align="left" valign="middle"><img src="'.site_url().'/wp-content/uploads/'.$image.'" width="274" height="196" mc:edit="Box_image_2" mc:allowdesigner alt="" /></td>
<td width="20"><!-- --></td>
<td width="280" valign="top" >
<table width="220" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="15"><!-- --></td>
</tr>
<tr>
<td align="left" class="body-text-bold" style="font-size:16px;font-weight:bold;" mc:edit="body_bold_text" mc:allowdesigner="mc:allowdesigner" ><strong>'.$deal['post_title'].'</strong></td>
</tr>
<tr>
<td height="16"><!-- --></td>
</tr>
<tr>
<td><!-- Red Box Start -->
<div class="red-box" style="background:#e9e9e9;border:1px solid #ccc;">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5"><!-- --></td>
</tr>
<tr>
<td width="7"><!-- --></td>
<td width="120" class="white-box" style="background:#ffffff;border:1px solid #ccc;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="5"><!-- --></td>
</tr>
<tr>
<td width="30"></td>
<td align="left" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_price_1" mc:allowdesigner="mc:allowdesigner">Τιμή</td>
<td width="30"></td>
</tr>
<tr>
<td height="5"><!-- --></td>
</tr>
<tr>
<td width="25"></td>
<td align="center" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_price_2" mc:allowdesigner="mc:allowdesigner">'.$price.'€</td>
<td width="20"></td>
</tr>
<tr>
<td height="5"></td>
</tr>
</table>
</td>
<td width="5"><!-- --></td>
<td width="120" class="white-box" style="background:#ffffff;border:1px solid #ccc;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="10"><!-- --></td>
</tr>
<tr>
<td width="25"></td>
<td align="left" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_discount_1" mc:allowdesigner="mc:allowdesigner">Έκπτωση</td>
<td width="30"></td>
</tr>
<tr>
<td height="5"><!-- --></td>
</tr>
<tr>
<td width="35"></td>
<td align="center" class="red-box-text" style="font-family:Arial, Helvetica, sans-serif;font-size:18px;font-weight:bold;" mc:edit="top_box_discount_2" mc:allowdesigner="mc:allowdesigner">'.$discount.'</td>
<td width="5"></td>
</tr>
<tr>
<td height="15"></td>
</tr>
</table>
</td>
<td width="5"><!-- --></td>
<td></td>
</tr>
<tr>
<td height="5"><!-- --></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td height="12"><!-- --></td>
</tr>
<tr>
<td align="left" class="body-text-bold" mc:edit="body_bold_text" mc:allowdesigner="mc:allowdesigner" ><!--REMOVED BY DUSTIN '.$deal['post_content'].'--></td>
</tr>
<tr>
<td height="0"><!-- --></td>
</tr>
<tr>
<td align="center" mc:edit="top_box_image" mc:allowdesigner="mc:allowdesigner" width="120px" style="background-color:#ac0003; color:#ffffff; border:1px solid #660b0e;cursor: pointer; display: block; font-family:Arial, Helvetica, sans-serif; font-size:12px; padding-top:5px; padding-bottom:5px; text-decoration:none; "><a style="color:#ffffff; text-decoration:none;" href="'.$deal['guid'].'" class="">Δες το Deal</a> </td>
</tr>
</table>
</td>
<td width="0"><!-- --></td>
</tr>
</table>
In case this helps: I send the email through MailChimp using FEED tag.
Thanks in advance for any help!
I think this issue is being caused by the widths of your table cells. Try setting the width twice for each table cell like this:
<td width="10" style="width:10px;">
Also add the following embedded styles:
table td {border-collapse: collapse;}
table { border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; }
Tip:
You might want to specify what version of Outlook is causing problems. Outlook 2007/2010/2013 react totally different to the same styling than Outlook 2003/2011 for example.
Simply,you can't divide images vertically , if you then it will show 1px space--divide images horizontaly and try it. It will be solved

Table layout design issue in Firefox browser

I have a table in my html page, in the table the first tr has images and next tr has text and it look's good in IE and Chrome browser's like this
but when I use in Firefox browser it looks like this:
I just used CSS (text-align:center) for td and (border-collapse: collapse,width: 100%) for table that's all...
My html code:
<table class="foottable" border="0" cellpadding="0" cellspacing="1">
<tr>
<td class="foottabcen"><img id="check" src="images/unchecked.png"/></td>
<td class="foottabcen"><img id="export" class="image1" src="images/excelicon.png" /></td>
<td class="foottabcen"><img id="test" class="image1" src="images/mailicon.png" /></td>
<td class="foottabcen"><img id="sms" class="image2" src="images/smsicon.png"/></td>
<td class="foottabcen"><img class="image1" src="images/charticon.png" /></td>
<td class="foottabcen"><img id="print" class="image1" src="images/printericon.png"/></td>
</tr>
<tr>
<td class="foottabcen">Select all</td>
<td class="foottabcen">Export to excel</td>
<td class="foottabcen">Mail</td>
<td class="foottabcen">SMS</td>
<td class="foottabcen">Graph</td>
<td class="foottabcen">Print</td>
</tr>
</table>
My CSS code:
.foottable
{
width: 100%;border-top: 2px solid #D4D4D4;border-collapse: collapse;background: white;
}
.foottabcen
{
color:black;text-align: center;
}
please help me.........
Not sure why you would want to do this way but I guess the better way would have been putting the image and text in the same td like:
<td>
<a href="#">
<span><img src="images/exl_icon.png" alt="" /></span>
<small>Export to excel</small>
</a>
</td> /* <a> is added considering these are clickable elements */
and apply display:block; to 'a', 'span' and 'small' through your css.
and probably the best way would have been just use text as link in the td and add a icon specific class to it:
<td>
Export to excel
</td>
and in your css it will look like this:
.ico_excel{
display:block;
text-align:center;
padding-top: x px; /* x should be more than the height of the icon */
background: transparent url(images/exl_icon.png) center top no-repeat;
}
try this
<table class="foottable" border="0" cellpadding="0" cellspacing="1">
<tr>
<td class="foottabcen"><img id="check" src="images/unchecked.png"/></td>
<td class="foottabcen"><img id="export" class="image1" src="images/excelicon.png" /></td>
<td class="foottabcen"><img id="test" class="image1" src="images/mailicon.png" /></td>
<td class="foottabcen"><img id="sms" class="image2" src="images/smsicon.png"/></td>
<td class="foottabcen"><img class="image1" src="images/charticon.png" /></td>
<td class="foottabcen"><img id="print" class="image1" src="images/printericon.png"/></td>
</tr>
<tr>
<td class="foottabcen1">Select all</td>
<td class="foottabcen1">Export to excel</td>
<td class="foottabcen1">Mail</td>
<td class="foottabcen1">SMS</td>
<td class="foottabcen1">Graph</td>
<td class="foottabcen1">Print</td>
</tr>
</table>
and css...give height for foottabcen as per ur requirement
.foottable
{
width: 100%;border-top: 2px solid #D4D4D4;border-collapse: collapse;
background: white;
}
.foottabcen
{
color:black;text-align: center;height:50px;
}
.foottabcen1
{
color:black;text-align: center;
}
check demo here..... http://jsfiddle.net/dBFfd/
did you try this...
<table>
<tr>
<td>
<img id="check" src="images/unchecked.png"/>
<span>sample</span>
</td>
</tr
</table>
but if you want my free assistant just email your code i try to fix it....