I'm currently making responsive-design for the website. I've tried many ways to make it great. Unfortunately, it didn't work out for me.
Here is my html code:
<div class="custom" >
<table class="yslygi">
<tbody>
<tr>
<td><img src="/images/pencil.png" alt="" /></td>
<td><img src="/images/arrow.png" alt="" /></td>
<td><img src="/images/larry.png" alt="" /></td>
<td><img src="/images/arrow.png" alt="" /></td>
<td><img src="/images/tools.png" alt="" /></td>
<td><img src="/images/arrow.png" alt="" /></td>
<td><img src="/images/clock.png" alt="" /></td>
</tr>
And here is my CSS:
.yslygi tr:first-child td:nth-child(2n+1) {
width: 150px;
padding: 20px 0 11px;
}
yslygi {
text-transform: uppercase;
font-size: 13px;
font-weight: 600;
text-align: center;
}
Responsive-design image
to make a responsive website, first rule is never user Table layout, instead use div base column layout. If you are new to responsive stuff, I suggest get familiar with Bootstrap Framework. It have good community and a great documentation. Get yourself familiar how responsive work and what are basic coding structure you need to follow.
First of all don't use table, avoid tables when ever you can. flex is your friend when it comes to stuff like this.
Sometimes y good use a framework like bootstrap.. its easy to manage the content but if you want only mantain the HTML as the image use width percentage to keep the proportion on multiple devices
Td.arrowImage{width: 10%;}
Td.Image{width: 17%}
Td.img{width: 100%}
.yslygi{width: 100%}
Related
I know this is simple for most people on here but I am trying my best. I need a little guidance with a project I am trying to do. I am working on a strictly html block widget on my wordpress site. I am trying to do a two column layout with images in each column. I have it working but I cannot figure out how to make the two images full width without space in between. Ive tried a millions ways but I am struggling. Any help would be amazing and appreciated!
The code I am currently using is
<table style="margin-left: 0px; margin-right: 0px; width: 100%;" border="0px" cellspacing="0px" cellpadding="0px">
<tbody><tr><td>
<img src="https://www.dailymutt.com/wp-content/uploads/2020/10/Untitled-1_01.jpg" alt="" /></td><td>
<img src="https://www.dailymutt.com/wp-content/uploads/2020/10/Untitled-1_02.jpg" alt="" /></td></tr></tbody>
</table>
Ive attached two images explaining the errors I am having with the coding I am doing.
This is where the two images have a padding of somesort
This is what I am trying to achieve.
So i figured it out myself. This is the new html code I had to use because there were css that my theme was over riding for the
<table>
<tbody><tr><td style="margin-left: 0px; margin-right: 0px; width: 100%; padding: 0px 0px !important;background-color:#000" border="0px" cellspacing="0px" cellpadding="0px">
<img src="https://www.dailymutt.com/wp-content/uploads/2020/10/Untitled-1_01.jpg" alt="" /></td><td style="margin-left: 0px; margin-right: 0px; width: 100%; padding: 0px 0px !important;background-color:#000" border="0px" cellspacing="0px" cellpadding="0px">
<img src="https://www.dailymutt.com/wp-content/uploads/2020/10/Untitled-1_02.jpg" alt="" /></td></tr></tbody>
</table>
This is my first post here, sorry if my formatting sucks.
Trying to assemble image slices together inside a to create the effect of a full size image. FF and edge both display the image correctly however chrome appears to be generating different heights despite all images in the row having the same height (they do have different widths). The problem only occurs when giving the table a set width (and shrinking the image size to fit within the table )
Ive tried changing .img to height:100% but that just changes the height to the full length of the original image warping it. Ive also tryed making height 100% with no luck
please note that the image pieces all have different heights per row and different widths per column do hardcoding is not possible
<style>
tr,
td,
table,
img,
tbody {
padding: 0;
}
table {
border-spacing: 0;
width: 300px;
}
img {
display: block;
width: 100%;
}
</style>
</head>
<body>
<table>
<tr>
<td><img src="https://i.imgur.com/OfAxJus.jpg"></td>
<td><img src="https://i.imgur.com/N1bcNYU.jpg"></td>
<td><img src="https://i.imgur.com/qCkFcIW.jpg"></td>
<td><img src="https://i.imgur.com/xqBG6zQ.jpg"></td>
</tr>
<tr>
<td><img src="https://i.imgur.com/bddCcSn.jpg"></td>
<td><img src="https://i.imgur.com/7ySyHqq.jpg"></td>
<td><img src="https://i.imgur.com/ulHRT4Q.jpg"></td>
<td><img src="https://i.imgur.com/reU0Gyr.jpg"></td>
</tr>
<tr>
<td><img src="https://i.imgur.com/rBsFVNI.jpg"></td>
<td><img src="https://i.imgur.com/ikub1e4.jpg"></td>
<td><img src="https://i.imgur.com/0RVlEWg.jpgg"></td>
<td><img src="https://i.imgur.com/v22RK32.jpg"></td>
</tr>
<tr>
<td><img src="https://i.imgur.com/1nLECe5.jpg"></td>
<td><img src="https://i.imgur.com/R9hI0ka.jpg"></td>
<td><img src="https://i.imgur.com/Bs8pQEY.jpg"></td>
<td><img src="https://i.imgur.com/ndLkcTb.jpg"></td>
</tr>
</table>
What can i do to make it so chrome doesnt generate the different heights?
I just want to decrease the size of space between this two images I put in the table. I'm so sorry I know this is just a basic html code. Please help me.
This is the code:
<table class="sample" width="200" border="0" cellpadding="1" cellspacing="1" >
<tr>
<td align="center" valign="center">
<a href="#" ><img src="images/reception2.png" alt="" /></a>
</br>
SERVICES
</td>
<td align="center" valign="center">
<img src="images/services2.png" alt="" />
</br>
OFFERS
</td>
</tr>
</table>
It's hard to advise without seeing the CSS you are using. You could try adjusting the width of the table.
Demo here: http://codepen.io/sol_b/pen/VmQGzr
You can remove the inline style on your table and then target it in your CSS, like this:
.sample {
width: 200px;
}
Change the width to whatever works.
you can use margin property of CSS. for your question margin-right for the SERVICES img and margin-left for the OFFERS img are proper solutions.
Try to add this snippet:
<img src="images/reception2.png" alt="" style="margin-right: -25px"/>
<img src="images/services2.png" alt="" style="margin-left: -25px"/>
Also, You can change the number range to finally find the suitable numbers.
I hate to admit this: I'm building a complicated, but gmail-friendly HTML email blast (inline styling). Anyway, it's a game of tables and split images, and I've seemed to have forgotten all my 1995 table mojo.
http://www.highgatecross.com/development/tables/
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="skyline.jpg" alt=""></td>
<td><img src="skyline-02.jpg" alt=""></td>
<td><img src="skyline-03.jpg" alt=""></td>
</tr>
<tr>
<td colspan="3"><img src="skyline-04.jpg" alt=""></td>
</tr>
</table>
I have a mystery 4-pixel "padding" below each images (the DOM panel in Firebug shows a cell "clientHeight" 4 pixels greater than my images).
I have tried every combination of deprecated HTML styling (heights, etc.) and CSS and no joy.
So, simply, how do I rid the 4 pixels and close the gap between rows?
Just use style="display: block" on the image.
Problem solved.
I should have checked StackOverflow first!
Either:
<img src="some.jpg" style="display: block" />
or
<img src="some.jpg" style="vertical-align: bottom" />
will eliminate the 4 pixels under the image in a table cell.
I fiddled around with a number of properties and it appears that setting line-height: 0 removes the gap.
Another way to fix is to add font-size: 0 on the td.
I am trying to eventually do a overlayed image mouseover, and instead of creating double the images to load, I have a masked overlay image for all 9 images.
I will be using "visibility:(hidden or visible)" to show the image on mouseover.
The problem I'm having is that after the "lock" image is adjusted to be on top of the original image, it is still affecting my spacing as if it was never moved.
example here: http://www.pixology.net/ciy/
Code:
<div id="main"> <br /><br />
<table width="700" height="700" border="0" align="center" cellpadding="10" cellspacing="2">
<tr>
<td><img src="images/main1.png" alt="One" width="214" height="214" /><img src="images/lock.png" alt="lock" class="lockon"/></td>
<td><img src="images/main2.png" alt="Two" width="214" height="214" /><img src="images/lock.png" alt="lock" class="lockon"/></td>
<td><img src="images/main3.png" alt="Three" width="214" height="214" /></td>
</tr>
<tr>
<td><img src="images/main4.png" alt="Four" width="214" height="214" /></td>
<td><img src="images/main5.png" alt="Five" width="214" height="214" /></td>
<td><img src="images/main6.png" alt="Six" width="214" height="214" /></td>
</tr>
<tr>
<td><img src="images/main7.png" alt="Seven" width="214" height="214" /></td>
<td><img src="images/main8.png" alt="Eight" width="214" height="214" /></td>
<td><img src="images/main9.png" alt="Nine" width="214" height="214" /></td>
</tr>
</table>
</div>
CSS:
#main {
height:800px;
width:800px;
margin: 0px auto;
background-color:#CCCCCC;
}
#main .lockon {
position:relative;
top:-214px;
visibility:visible;
}
#main .lockoff {
position:relative;
top:-214px;
visibility:hidden;
}
The problem I'm having is that after
the "lock" image is adjusted to be on
top of the original image, it is still
affecting my spacing as if it was
never moved.
That in essence is how position relative works - it reserves space "in flow". If you dont want the space reserved use absolute positioning - or instead of top use a negative margin-top. On top of that using display: hidden simply hides the element - not the space it takes up while display: none will make it as though the element isnt in the DOM at all as far as layout is concerned.
In order to make the absolute positioning origin attached to the contianer element you need to make the container position: relative in this case the container is your td. but im not sure how that will work out so you may want to put both images inside a div within the td. But if youre doing that i would just apply styles to the div istelf and make your images background images on that div using class/id combinations to toggle.