I'm trying to get the social media sprites in this HTML table at https://www.alexcurriemedia.com/video/ to press up flush with the image above it. Cannot figure out a way to do this.
Can't add another table above it because the upper image is a wordpress shortcode that doesn't seem to work within the table.
Here is the code:
<table><center>[wds id="3"]
<td nowrap><a href="http://www.facebook.com/alexcurriemedia" target="_blank">
<div class='sprite Facebook1' width="100"></div></a></td>
<td nowrap><a href="http://www.twitter.com/alexcurriemedia" target="_blank">
<div class='sprite Twitter1'></div></a></td>
<td nowrap><a href="http://www.flickr.com/alexcurrie" target="_blank">
<div class='sprite Flickr1'></div></a></td>
<td nowrap><a href="http://www.alexcurriemedia.tumblr.com" target="_blank">
<div class='sprite Tumblr1'></div></a></td>
<td nowrap><a href="http://www.instagram.com/alex.currie" target="_blank">
<div class='sprite Instagram1'></div></a></td><td></td>
</center></table>
Thanks so much!!
The stray <p> tags that you see are likely a result of Wordpress automatically inserting them through the text editor. You should not place a <div> inside of an <a> tag if at all possible. While technically valid, I've seen it cause problems with things such as Wordpress's text editor. If you look at the source code in your browser, you will notice that the link is actually being rendered twice, like so:
<td nowrap="">
<a href="http://www.twitter.com/alexcurriemedia" target="_blank"><p></p>
<div class="sprite Twitter1"></div>
</a>
<p>
</p>
</td>
The following code should work better:
<table>
<tbody><tr>
<td nowrap>
</td>
<td nowrap>
<a class="sprite Twitter1" href="http://www.twitter.com/alexcurriemedia" target="_blank"></a>
</td>
<td nowrap>
<a class="sprite Flickr1" href="http://www.flickr.com/alexcurrie" target="_blank"></a>
</td>
<td nowrap>
<a class="sprite Tumblr1" href="http://www.alexcurriemedia.tumblr.com" target="_blank"></a>
</td>
<td nowrap>
<a class="sprite Instagram1" href="http://www.instagram.com/alex.currie" target="_blank"></a>
</td>
</tr>
</tbody>
</table>
Once you change that, simply add the following to your CSS:
.sprite {
display: block;
}
This will cause the content in each <td> to align at the top, rather than in the center as they are doing currently.
If you still have trouble with the <p> tags being automatically inserted, you may look into this function.
End result:
Related
I wanted to try doing a simple number scale going from 1 to 10. I know there's many ways to go about it and here's what I tried:
<div class="rate-container">
<p class="first">Extremely Unlikely</p>
<a class="rate">1</a>
<a class="rate">2</a>
<a class="rate">3</a>
<a class="rate">4</a>
<a class="rate">5</a>
<a class="rate">6</a>
<a class="rate">7</a>
<a class="rate">8</a>
<a class="rate">9</a>
<a class="rate">10</a>
<p class="first">Extremely Likely</p>
</div>
I am trying to have the text be exactly placed next to the number 1 and 10 items respectively. I did so with a table in the following fashion.
<table>
<tr>
<td> <a class="rate">1</a> </td>
<td>
<p class="first">Extremely Unlikely</p>
</td>
</tr>
<tr>
<td><a class="rate">2</td>
</tr>
<tr>
<td><a class="rate">3</td>
</tr>
<tr>
<td><a class="rate">4</td>
</tr>
<tr>
<td><a class="rate">5</td>
</tr>
<tr>
<td><a class="rate">6</td>
</tr>
<tr>
<td><a class="rate">7</td>
</tr>
<tr>
<td><a class="rate">8</td>
</tr>
<tr>
<td><a class="rate">9</td>
</tr>
<tr>
<td><a class="rate">10</td>
<td>
<p class="last">Extremely Likely</p>
</td>
</tr>
</table>
I know about flexbox and other css properties that can help, but from what I've tried nothing seems to help align the text properly without having to compromise on something else.
All help and advice is appreciated!
<div class="rate-container">
<div>
<a class="rate">1</a>
<p class="first">Extremely Unlikely</p>
</div>
<a class="rate">2</a>
<a class="rate">3</a>
<a class="rate">4</a>
<a class="rate">5</a>
<a class="rate">6</a>
<a class="rate">7</a>
<a class="rate">8</a>
<a class="rate">9</a>
<div>
<a class="rate">10</a>
<p class="first">Extremely Likely</p>
</div>
</div>
CSS:
div.rate-container {
display: flex;
flex-direction: column;
}
p,a {
display: inline;
}
You could actually nevermind the whole flex div, remove the other inner divs, just the the p and a displays to inline, and use <br>s to break the lines. <br>s are frowned upon tho, mostly because they clutter the code(and they would in this case)
You could take a slightly different approach as the text is just annotating the numbers rather than being part of the content, by using pseudo elements on those values you wish to annotate.
This snippet puts an after pseudo element on the first and last child of your initial list and removes the p elements from the HTML.
.rate {
display: block;
}
.rate-container a:first-child::after {
content: '\00a0 \00a0 Extremely unlikely';
}
.rate-container a:last-child::after {
content: '\00a0 Extremely likely';
}
<div class="rate-container">
<a class="rate">1</a>
<a class="rate">2</a>
<a class="rate">3</a>
<a class="rate">4</a>
<a class="rate">5</a>
<a class="rate">6</a>
<a class="rate">7</a>
<a class="rate">8</a>
<a class="rate">9</a>
<a class="rate">10</a>
</div>
i am trying to click on 2nd item(Not Know) in the Td element. I was able to click on the 1st item(known Issue) by using its xpath. How ever i am not able to do the same thing with the 2nd option. i am getting following error
Unable to locate an element with the xpath expression
//*[#id='group_tree']/div/div/div/div[1]/div/div[1]/table/tbody/tr/td[[contains(text(), 'Not Known')]
because of the following error:
below is my code:
driver.findElement(By
.xpath("//*[#id='group_tree']/div/div/div/div[1]/div/div[1]/table/tbody/tr/td[[contains(text(), 'Not Known')]"));
and my HTML is
<div style="display: block;">
<div>
<table cellspacing="0px" cellpadding="0px"
style="background-color: transparent;">
<tbody>
<tr>
<td><img class="tree" src="images/s.gifx" alt=""
style="margin-left: 16px;"></td>
<td class="tree_spacer"><img alt="" src="images/nav_bult.gifx"></td>
<td title="" class="tree_item_text"><a
name="37fd8721a9729140d11a2c59127b17a6">Known issue</a><span></span></td>
</tr>
</tbody>
</table>
<div></div>
</div>
<div>
<table cellspacing="0px" cellpadding="0px"
style="background-color: transparent;">
<tbody>
<tr>
<td><img class="tree" src="images/s.gifx" alt=""
style="margin-left: 16px;"></td>
<td class="tree_spacer"><img alt="" src="images/nav_bult.gifx"></td>
<td title="" class="tree_item_text"><a
name="ea1e8721a9729140d11a2c59127b17fb">Not known</a><span></span></td>
</tr>
</tbody>
</table>
<div></div>
</div>
</div>
i tried finding the element by name, by xpath and contains but everything is throwng error
Please Help
Before doing anything first check if your html is valid, I verified that your html misses matching </img> tags for the existing <img> tags.
Now, I assume you want the td elements with Known issue and Not known as text for a elements.
The following xpaths will give you those :
//td[#class='tree_item_text' and ./a/text()='Known issue']
//td[#class='tree_item_text' and ./a/text()='Not known']
I am trying to create a button that looks like with text font-size:14px sitting centered middle with a special character (›) font-size:40px;
Getting the right arrow ( › ) to sit appropriately vertically aligned for email is seemingly impossible.
Currently I am using:
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td bgcolor="#b8237" background="" height="42" width="196" style="color:#FFFFFF; font-family:Arial, Helvetica, sans-serif;font-size:14px;" align="center" valign="middle">
<a href="" alt="Get Your $1.50 Coupon" title="Get Your $1.50 Coupon" target="_blank" style="text-decoration:none;color:inherit;">
Get Your $1.50 Coupon
<span style="font-size:40px;">›</span>
</a>
</td>
</tr>
</table>
Any assistance would be much appreciated. This needs to be bulletproof for emails. I have researched and tried multiple different ways, but have come up empty-handed.
Also, no generator allows for aligning varying font-size text.
Thanks,
Given that you want this to be bulletproof, my recommendation for something like this would be to use an image for the text and arrow, and just wrap an anchor around it. Otherwise it would be a nightmare trying to get each email client to play ball.
If this needs to remain as text, then I'd suggest you create separate cells for the text and arrow and setting them to vertical-align: middle, but you will inevitably get annoyingly varied results across clients.
Here is the updated code:
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td bgcolor="#b8237" background="" height="42" width="196" style="color:#FFFFFF; font-family:Arial, Helvetica, sans-serif;font-size:14px;" align="center" valign="middle">
<a href="" alt="Get Your $1.50 Coupon" title="Get Your $1.50 Coupon" target="_blank" style="text-decoration:none;color:inherit;">
<span>Get Your $1.50 Coupon </span>
<span style="font-size:40px;">›</span>
</a>
</td>
</tr>
All I did, I added "Get Your $1.50 Coupon " also in <span> tag
And I gave CSS: td span{ display:inline-block; vertical-align:middle;}
Here is the Fiddle: http://jsfiddle.net/c237t/
And If you cannot give separate CSS then here is the other way around:
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td bgcolor="#b8237" background="" height="42" width="196" style="color:#FFFFFF; font-family:Arial, Helvetica, sans-serif;font-size:14px;" align="center" valign="middle">
<a href="" alt="Get Your $1.50 Coupon" title="Get Your $1.50 Coupon" target="_blank" style="text-decoration:none;color:inherit;">
<span style="vertical-align:middle;">Get Your $1.50 Coupon </span>
<span style="vertical-align:middle; font-size:40px;">›</span>
</a>
</td>
</tr>
Here is the Fiddle: http://jsfiddle.net/2X9kS/
We have a custom implementation of CellTable in which there is a custom column to render label and image. As part of hovering on a table row, we call table.redrawRow(rowNum) to render some context menu.
However, doing that, cause the text and image column to re-render the image (make a server call to fetch the image). This causes a flickering effect. This only happens in Chrome (version I am using - Chrome27)
The table row looks like this:
<tr __gwt_row="0" __gwt_subrow="0" class="GAH0TQLMKD">
<td class="GAH0TQLKKD GAH0TQLNKD GAH0TQLOKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-65" tabindex="0">
<div style="border-collapse: separate; border-spacing:0">
<div style="display:table-cell;vertical-align:middle">
<img src="icon.png" alt="" style="vertical-align:middle; border: 0;width:16px;height:16px; ">
</div>
<div class="GAH0TQLMJD" style="display:table-cell"><b>Contiki</b></div>
</div>
</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-66">Travels</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-67">Blah</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-68">Blah</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-69">2013-07-10</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-70">5</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-71">07/10/2013 01:53 AM</div>
</td>
<td class="GAH0TQLKKD GAH0TQLNKD GAH0TQLILD GAH0TQLDAD" align="right">
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-72">
<div class="GAH0TQLFAD">
<div style="width:64px; height:17px"></div>
</div>
</div>
</td>
</tr>
I don't see flickering on Firefox or IE9.
Note: My Cache-Control headers are set to no-cache.
Any thoughts? Ideas?
If you ask the browser not to cache the image, and you ask it to draw the image, it'll re-download it.
So either change your caching strategy for the image, and/or your strategy for updating the table (using a redrawRow during a hover to display something new seems suboptimal; the cells should rather listen to the mouse events and update their DOM dynamically)
I am currently trying to add some Design to an selfprogrammed board. Somehow I am experiencing odd buggs with the CSS rendering:
Every Row of that board is a .BoardRow Class to be formated in CSS. So, I am using:
.BoardRow td {
border: 2px dotted #4E6011;
background-image:-webkit-linear-gradient(bottom, #FFFFFF 33%, #EFEFEF 90%); /* Chrome, Safari */
}
this to add some nice looking borders around each row. Somehow always the top row is failing to work as intended. When zooming in with CTRL + Mouse in Google Chrome the top border always changes as shown in the picture. What can i do about this?
EDIT: Here is the full generated HTML Code:
<div id="Top">
<div id="Navi"> <a class="Link" href="index.php?s=home">Startseite</a> <a class="Link" href="index.php?s=physicians">Ärzteliste</a> <a class="Link" href="index.php?s=pmr">Polymyalgia Rheumatica</a> <a class="Link" href="index.php?s=logout">Abmelden</a> <a class="Link" href="index.php?s=course">Krankheitsverlauf</a> <a class="Link" href="index.php?s=board">Forum</a> </div>
</div>
<div id="Main">
<table id="Board">
Seite (1 von 1)
<tr>
<td class="BoardHeadline">Thema</td>
<td class="BoardHeadline">Beiträge</td>
<td class="BoardHeadline">Angesehen</td>
</tr>
<tr class="BoardRow">
<td class="BoardName">asdfasdfas von (Unbekannter Benutzer)<br />
geschrieben am 25:03:2013 um 15:43 </td>
<td class="BoardCounter">3</td>
<td class="BoardCounter">20</td>
</tr>
<tr class="BoardRow">
<td class="BoardName">Titelasdgkljahskjdghkjasg von (Unbekannter Benutzer)<br />
geschrieben am 25:03:2013 um 16:14 </td>
<td class="BoardCounter">1</td>
<td class="BoardCounter">4</td>
</tr>
<tr class="BoardRow">
<td class="BoardName">asdjglkajsljkdg von (Unbekannter Benutzer)<br />
geschrieben heute um 12:58 </td>
<td class="BoardCounter">3</td>
<td class="BoardCounter">12</td>
</tr>
</table>
<br />
Neues Thema eröffnen </div>
<div id="UserPanel"> Benutzerprofil </div>
and here is the CSS:
CSS
Please note that i am not an HTML or CSS expert. ;)
I am using Google Chrome 19 (old portable version on my usb stick) but this is also occuring on the local installed IE 8.
the problem is, the two dotted border are conflicting, try to use a border : colapse