Add a space between html link and logo - html

I am trying to add a space between the image logo and the link .
Not sure what to do .
I tried adding space in the text but didn't work (> FAA/ATC NEXT DAY PLAN)
I am backend guy but sometimes need to mess with front end :(
<tr> <td> <img src="images/page_white_acrobat_small.png" align="absbottom" /> <a style="font-size: 12px" href = ""onclick="Popup.open({url:'PERTI_Plan.pdf',width:800,height:500,resizable:'yes', separateWindow:true});">FAA/ATC NEXT DAY PLAN</a></td></tr>

Unfortunately/fortunately, as you've now realized, multiple white space does not persist in the HTML layout.
CSS is your friend when it comes to formatting. You can add this rule to your stylesheet,
tr td img {
margin-right: 1rem;
}
Otherwise, if you don't have a stylesheet, try adding an in-line style to your image tag as follows,
<tr>
<td>
<img src="images/page_white_acrobat_small.png" style="margin-right: 1rem;" align="absbottom" />
<a style="font-size: 12px" href = ""onclick="Popup.open({url:PERTI_Plan.pdf',width:800,height:500,resizable:'yes', separateWindow:true});">FAA/ATC NEXT DAY PLAN</a>
</td>
</tr>
Notice here that I have added style="margin-right: 1rem" to your tag. This will apply this CSS rule directly to that tag, adding a margin on the right side with a size of 1 rem.

White space in your source code is truncated. Instead use a margin on the image or link.
E.g.
img {
margin-right: 2em
}

you need to give some margin here to give space between the image and link, you can give margin-left to a
td a{
margin-left: 1px;
}
or margin-right to img
td img{
margin-right: 1px;
}

you have sevral way to do this :
the better solution is by css you can do :
td img{
margin-right: 10px;
}
but if you do this you will affect all the td img of your page.
in that case i advise you to put a class on your td to affect only this element and it's better if you have a list of this kind of file.
<tr class="fileMoreIcon">
<td>
<img src="images/page_white_acrobat_small.png" align="absbottom" />
<a ...........
and in css
.fileMoreIcon img{
margin-right: 10px;
}
one other way is just to add a html space character
<tr>
<td>
<img src="images/page_white_acrobat_small.png" align="absbottom" />
<a style="font-size: 12px" href = ""onclick="Popup.open({url:PERTI_Plan.pdf',width:800,height:500,resizable:'yes', separateWindow:true});">FAA/ATC NEXT DAY PLAN</a>
</td>
</tr>

Related

In a html table cell, how can I force images to be the bottom left and the bottom right that have different heights?

I have a table with text and images. I now want to add a few images and have them aligned to the bottom of the cell. What is the correct CSS to force an image to be aligned to the bottom left of a cell?
Here is the relevant CSS:
.bottomRight {
bottom: 0;
float: right;
}
.bottomLeft {
bottom: 0;
float: left;
}
Here is my html:
<td width="240">
<span style="float:right;margin-left: 1px; margin-bottom: 1px;">
<b></b>
</span>
Info
<br/><br/>
<img src="/Content/shortImage.png" class="bottomLeft">
<img class="bottomRight" height="35" width="35" title="Name" src="/Content/tallImage.jpg" >
</td>
The image tallImage.jpg does work and shows up at the bottom right but the shortImage.png which is smaller in height doesn't go all the way to the bottom of the table cell.
Any suggestions on how i get the shortImage and largeImage to both align to bottom of a table cell?
Use vertical-align:bottom;
If you differentiate your selected elements, why not use a class?
http://jsfiddle.net/SinisterSystems/x3vc7/2/
HTML:
<table>
<tr>
<td>Hello world</td>
<td class="image">
<img src="http://www.itworldcanada.com/wp-content/uploads/2013/08/Windows-XP-migration-FEature-Image-42x42.jpg" />
</td>
</tr>
</table>
CSS:
td {
height:200px;
border:1px solid #000;
}
.image {
vertical-align:bottom;
}
EDIT:
I said let us continue this discussion in chat. If your idea is to display non-tabuler-data. Read here about tabular data.
You Should Not Use a Table If:
The main purpose of the table is to position the contents on the page in some way. For example, to add spacing around an image, to place "bullet" icons on a list, or to force a block of text to act like a pull quote.

Format table so that rows are closer together

We have a items lined up in a table with no borders or padding. Each first row contains a graphic and the row immediately below is either blank or contains an anchor link to a disclaimer. The link should be closer to the graphic directly above it, but there's still a big gap.
What can I do to format the table so that the graphics and the disclaimer link can be closer?
This is the link to the page I'm working on: http://edenred.jp/for-beneficiaries/for-current-beneficiaries/main-affiliates-list.aspx
Here is a sample of the code: (this was taken from the third row from the bottom)
<tr>
<td>
<span style="font-size: 14px;"><img alt="てんや" src="/getattachment/For-Beneficiaries/For-current-beneficiaries/Main-affiliates-list/rogo35-(1).gif.aspx" style="width: 160px; height: 48px;" title="てんや" /></span></td>
<td>
<span style="font-size: 14px;"><img alt="とりかく" src="/getattachment/For-Beneficiaries/For-current-beneficiaries/Main-affiliates-list/rogo36-(1).gif.aspx" style="width: 160px; height: 48px;" title="とりかく" /></span></td>
<td>
<span style="font-size: 14px;"><img alt="とんかつがんこ" src="/getattachment/For-Beneficiaries/For-current-beneficiaries/Main-affiliates-list/rogo37-(1).gif.aspx" style="width: 160px; height: 48px;" title="とんかつがんこ" /></span></td>
<td>
<span style="font-size: 14px;"><img alt="とんかつ浜勝" src="/getattachment/For-Beneficiaries/For-current-beneficiaries/Main-affiliates-list/rogo38-(1).gif.aspx" style="width: 160px; height: 48px;" title="とんかつ浜勝" /></span></td>
</tr>
<tr>
<td style="text-align: right; vertical-align: top;">
<span style="font-size:14px;">※1</span></td>
<td style="text-align: right; vertical-align: top;">
<span style="font-size:14px;">※1</span></td>
<td>
</td>
<td>
</td>
</tr>
You have padding set to 10px:
.cpMain td {
vertical-align: top;
padding: 10px; // play with it, change to padding: 0px for the beginning
width: 220px;
}
remove it and it will look good.
Or you can create a css class below the .cpMain td class:
.table-no-padding td {
padding: 0px;
}
and add this class to the list of css classes in your html:
<table class="table-no-padding">
<!-- td content -->
</table>
This is generally caused when you do not define cellspacing=0 and cellpadding=0 while writing table tag. Please check for it.
In your code, I can see that you have applied 10px padding to the class .cpMain td
And 5px right padding is applied to .fruitboxDeliveryForm table.customer td, .simpleForm td
Removing or setting them to 0 these may help you achieve it.
Browsers have a default display for every element. You can uses a tool like firebug for firfox to inspect elements and see what they are for yourself. If you do not explicitly set the style the default will be used.
Using a tool like firebug will also show you where applied styles are coming from
Use CSS to set the style as required. :Set cellpadding and cellspacing in CSS?
In each td of the anchore, set padding-top to 0
padding-top="0px"
eg
<td style="text-align: right; vertical-align: top;padding-top:0px;">
<span style="font-size: 14px;">※8</span></td>
hope it helps :)

CSS Sprites on Table TD

I want to make a menu with CSS sprites but there's not ONE browser on the planet that can read it. My problem can be found here.
My CSS is:
#menuMusica{
width:340px;
height:190px;
background:url('images/menuMusic.png') 0px 0px;
}
#menuMusica a:hover{
background: url('images/menuMusic.png') 0px -190px;
}
And my HTML:
<div id="menu">
<table cellspacing=100px>
<tr>
<td id="menuMusica" onmouseover="soundGuitar();">
<img src="images/menuP.png" border=0>
</td>
<td id="menuPhoto" onmouseover="soundPhoto();">
<img src="images/menuP.png" border=0>
</td>
</tr>
</table>
</div>
Change #menuMusica a:hover { to #menuMusica:hover {.
The problem is that the 'mouseout' background is applied to your td element, but your 'mouseover' background is applied to the a element inside of it. Since the a element doesn't fill up all the available vertical space, you can't see the rollover.
The quickest solution is to add display: block; to the styles for your a elements.
If you want to be consistent, you should also move the background CSS property from #menuMusica to #menuMusica a.

CSS hover creating hotspot in entire table row

I recently applied a hover feature to a set of buttons. When applied to a different website the coding was fine. When applied to this site the link/hotspot goes to the next button. For example: I have buttons home/about/gallery/blog/prints/contact and you would think with the dimensions set in CSS style sheet that the link would only apply to those dimensions. Not with this one. The link/hotspot shows linked to index.shtml from the edge of the table to the other side of the home button. There are spaces between buttons but the link/hotspot goes 50%across the space until it hits the next buttons link/hotspot. And the final button "contact" spans across to the opposite edge of the table. Any clues as to what I am doing wrong?
CSS:
div.nav-home {
margin-top: 10px;
margin-bottom: 0px;
margin-left: 130px;
Margin-right: -60px;
background-position: right top;
background-repeat: no-repeat;
width: 75px;
height: 64px;
}
#home {
background-image: url('img/home.png');
}
#home:hover {
background-image: url('img/home_hover.png');
}
Index.shtml:
<table width="1213" height="64" align="center" background="img/tablebg2.png">
<!--#include file="menubuttons.html" -->
menubuttons.html:
<tr>
<td align="center" width="75">
</div>
</td>
<td align="center" width="86">
</div>
</td>
<td align="center" width="94">
<a href="/gallery.shtml" title="GALLERY" ><div id="gallery" class="nav-gallery">
</div></a>
</td>
<td align="center" width="63">
</div>
</td>
<td align="center" width="85">
<a href="/prints.shtml" title="PRINTS" ><div id="prints" class="nav-prints">
</div></a>
</td>
<td align="center" width="103">
<a href="/contact.shtml" title="CONTACT" ><div id="contact" class="nav-contact">
</div></a>
</td>
</tr>
FIXED: (maybe not properly?)
I have only been coding for 2 months and have a pretty good idea on how to write it out, but I don't know what everything means such as the DIV tag. I know I was searching on here last night and I assumed I was to put the div inside a TD.
I was able to fix everything by simply adding a few spacer.png's before the first button in between each set of buttons and after the last button. This also fixed my spacing issues on the sides.
Thanks for the help. I simply am trying to find an easy way to make my buttons change on hover. This method was the first I found last night on here and am now trying to perfect it.. well in my head at least. I need to research on the unordered list a little because I have heard that that makes things more simple...
Here is the link(based off the back end of a site I recently finished) www.blackmarkettattoos.com/amysesco/index.shtml
I think the problem is the fact that you are using DIV, which is a container tag inside table's cell, and for both you apply style (to the DIV as class and to the TD as inline).
Generally, it is better to create menus with lists, but if you must use the code you provided, then try to remove width: 75px; from the div.nav-home.
Check these two links for how to create CSS menus with lists:
css.maxdesign.com.au
Dynamic Drive CSS Library

<img> in <table> without any spaces

I am trying to put two images side by side inside a <td> (also tried one <td> for each img), but has some white spaces between the images, and do not understand where they come .. I can solve my problem using float, but I'm trying to avoid this. If someone can explain to me why this happens. I took some tips from other questions, but it doesn't work.
Here is my code:
<html>
<head>
<style "text/css">
td, tr, img { padding: 0px; margin: 0px; border: none; }
table { border-collapse: collapse;}
</style>
</head>
<body style="background: black;">
<center>
<table cellspacing="0" cellpadding="0">
<tr>
<td>
<img alt="" title="" src="http://i.min.us/ijCTdY.jpg" />
</td>
</tr>
<tr>
<td>
<img alt="" title="" src="http://i.min.us/jj7Yt6.jpg"/>
<img alt="" title="" src="http://i.min.us/ijCo96.jpg"/>
</td>
</tr>
</table>
</center>
</body>
you can notice that the top image has 800 px height, and the other ones has 400px each one, what I need is some kinda square, without any spaces between the images.
imgs are inline elements. The horizontal space between the images is coming from the whitespace between the images in the HTML. The same reason that there's a space between the characters here.
So, to fix that, remove the whitespace: http://jsfiddle.net/xMW7N/2/
The vertical space is also because the images are inline elements. The gap is the space reserved for descenders in letters like g and j.
To fix that, set vertical-align: top on img: http://jsfiddle.net/xMW7N/3/
Although in your case (as mentioned in your question), setting float: left works just fine: http://jsfiddle.net/xMW7N/4/
That works because float: left forces display: block, so all of the problems caused by the images being inline are resolved.
It's the whitespace in your markup itself. If you remove the line-break and the spaces between the two images, the space will go away.
The whitespace is treated as text, as a single space character.
This is easier done without tables: http://jsfiddle.net/feSxA/
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
background: black;
}
.imgHolder {
width: 800px;
margin: auto;
}
.imgHolder img {
float: left;
}
</style>
</head>
<body>
<div class="imgHolder">
<img alt="" title="" src="http://i.min.us/ijCTdY.jpg" />
<img alt="" title="" src="http://i.min.us/jj7Yt6.jpg" />
<img alt="" title="" src="http://i.min.us/ijCo96.jpg" />
</div>
</body>
</html>
try adding a border="0" in your table element
Add display: block; to your images.
This will remove any gaps caused by the image being inline but you may need to split the cells up to allow them to sit side by side.
You can also remove the whitespace which should get rid of the whitespace.