I have a question on jquery.mobile. I can show the 2 photo on my mobile. But it has interspaced between photo1 and photo2.
Could you give any ideas , I don't want to a space between objects.
many thanks.
css
.ui-grid-b img {
width : 50%;
height : 52vw;
}
html
<div class="ui-grid-b">
<a href="xxx.htm">
<img alt="alt..." src="img/image.jpg" />
</a>
<a href="xxx.htm">
<img alt="alt..." src="img/image.jpg" />
</a>
<a href="xxx.htm">
<img alt="alt..." src="img/image.jpg" />
</a>
<a href="xxx.htm">
<img alt="alt..." src="img/image.jpg" />
</a>
</div>
.ui-grid-b {
line-height : 0;
}
Related
I am trying to create an email signature using html and an image I designed in Photoshop. I have sliced the image in PS and saved the slices out onto my PC. I now want to add links to certain slices and have managed to do this but the code is very messy and poor so I know that there is a better way to do it. I have attached the code below.
The links are not the actual links and are just placeholders for now. I also know that I need to save the images externally and will get round to it but just want to try and get the code sorted for now. I also understand that the image size is massive for an email signature so can I just add a "max-width" and "max-height" to the code to size it down or do I have to individually change all the sizes of each slice?
Finally, will this a spliced html image display well as an email signature or, because there are so many images attached to it, will it just go straight into spam?
<!DOCTYPE html>
<html>
<style>
div {
position: absolute;
}
</style>
<head></head>
<body>
<a href="" />
<div style="background-image:url('img/img1.jpg'); left:0px; top:0px; width:2000px; height:122px"></div>
<a href="" />
<div style="background-image:url('img/img2.jpg'); left:0px; top:122px; width:124px; height:222px"></div>
<a href="https://www.linkedin.com" />
<div style="background-image:url('img/img3.jpg'); left:124px; top:122px; width:866px; height:198px"></div>
<a href="" />
<div style="background-image:url('img/img4.jpg'); left:990px; top:122px; width:1010px; height:102px"></div>
<a href="" />
<div style="background-image:url('img/img5.jpg'); left:990px; top:224px; width:246px; height:576px"></div>
<a href="https://www.bing.com" />
<div style="background-image:url('img/img6.jpg'); left:1236px; top:224px; width:630px; height:120px"></div>
<a href="" />
<div style="background-image:url('img/img7.jpg'); left:1866px; top:224px; width:134px; height:576px"></div>
<a href="" />
<div style="background-image:url('img/img8.jpg'); left:124px; top:320px; width:866px; height:24px"></div>
<a href="" />
<div style="background-image:url('img/img9.jpg'); left:0px; top:344px; width:122px; height:456px"></div>
<a href="https://www.google.com" />
<div style="background-image:url('img/img10.jpg'); left:122px; top:344px; width:540px; height:150px"></div>
<a href="" />
<div style="background-image:url('img/img11.jpg'); left:662px; top:344px; width:328px; height:456px"></div>
<a href="" />
<div style="background-image:url('img/img12.jpg'); left:1236px; top:344px; width:630px; height:42px"></div>
<a href="" />
<div style="background-image:url('img/img13.jpg'); left:1236px; top:386px; width:48px; height:414px"></div>
<a href="https://www.bing.com" />
<div style="background-image:url('img/img14.jpg'); left:1284px; top:386px; width:482px; height:56px"></div>
<a href="" />
<div style="background-image:url('img/img15.jpg'); left:1766px; top:386px; width:100px; height:414px"></div>
<a href="" />
<div style="background-image:url('img/img16.jpg'); left:1284px; top:442px; width:482px; height:42px"></div>
<a href="" />
<div style="background-image:url('img/img17.jpg'); left:1284px; top:484px; width:62px; height:316px"></div>
<a href="https://www.linkedin.com" />
<div style="background-image:url('img/img18.jpg'); left:1346px; top:484px; width:94px; height:90px"></div>
<a href="https://www.facebook.com" />
<div style="background-image:url('img/img19.jpg'); left:1440px; top:484px; width:60px; height:82px"></div>
<a href="https://www.twitter.com" />
<div style="background-image:url('img/img20.jpg'); left:1500px; top:484px; width:94px; height:90px"></div>
<a href="https://www.instagram.com" />
<div style="background-image:url('img/img21.jpg'); left:1594px; top:484px; width:92px; height:82px"></div>
<a href="" />
<div style="background-image:url('img/img22.jpg'); left:1686px; top:484px; width:80px; height:316px"></div>
<a href="" />
<div style="background-image:url('img/img23.jpg'); left:122px; top:494px; width:540px; height:30px"></div>
<a href="" />
<div style="background-image:url('img/img24.jpg'); left:122px; top:524px; width:2px; height:88px"></div>
<a href="https://www.google.com" />
<div style="background-image:url('img/img25.jpg'); left:124px; top:524px; width:418px; height:62px"></div>
<a href="" />
<div style="background-image:url('img/img26.jpg'); left:542px; top:524px; width:120px; height:276px"></div>
<a href="" />
<div style="background-image:url('img/img27.jpg'); left:1440px; top:566px; width:60px; height:234px"></div>
<a href="" />
<div style="background-image:url('img/img28.jpg'); left:1594px; top:566px; width:92px; height:234px"></div>
<a href="" />
<div style="background-image:url('img/img29.jpg'); left:1346px; top:574px; width:94px; height:226px"></div>
<a href="" />
<div style="background-image:url('img/img30.jpg'); left:1500px; top:574px; width:94px; height:226px"></div>
<a href="" />
<div style="background-image:url('img/img31.jpg'); left:124px; top:586px; width:418px; height:26px"></div>
<a href="https://www.google.com" />
<div style="background-image:url('img/img32.jpg'); left:122px; top:612px; width:406px; height:62px"></div>
<a href="" />
<div style="background-image:url('img/img33.jpg'); left:528px; top:612px; width:14px; height:188px"></div>
<a href="" />
<div style="background-image:url('img/img34.jpg'); left:122px; top:674px; width:406px; height:126px"></div>
</body>
</html>
Email is not web! Absolute positioning is an advanced trick that requires lots of hacks to work, and even <div>s are problematic, for Outlooks. Background images are also very tricky (there are plenty of answers on SO about these things individually).
Nobody knows all the spam rules, because otherwise people would subvert them, however, having so many links at the bottom of your message could easily be considered spammy. It's also risky because it's not normal. So I would advise against this method.
You will want to produce a HTML table, with <img>s (or just one image). However, best practice is to write out text in HTML, rather than have it in the image. I can't see the image so I can't give you sample code, other than something generic for a scalable image:
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="#">
<img src="https://via.placeholder.com/600x200" width="600" style="max-width:100%;height:auto;" />
</a>
</td>
</tr>
</table>
</body>
I'm looking for a CSS option that will allow me to mouseover a thumbnail image to replace the "large" image. The trick here is using the anchor href from the thumbnail link as the large image source.
Below code works only with javascript but I need to be done it with CSS and without javascript.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="image-1">
<img src="http://dummyimage.com/600x400/000/fff&text=1">
</div>
<div id="thumbs" class="mouseover">
<a class="thumb-image-1" id="thumb_1" href="http://dummyimage.com/600x400/000/fff&text=1" title="1"><img src="http://dummyimage.com/60x40/000/fff&text=1" alt="image 1"/></a>
<a class="thumb-image-1" id="thumb_2" href="http://dummyimage.com/600x400/000/fff&text=2" title="2"><img src="http://dummyimage.com/60x40/000/fff&text=2" alt="image 1"/></a>
<a class="thumb-image-1"id="thumb_3" href="http://dummyimage.com/600x400/000/fff&text=3" title="3"><img src="http://dummyimage.com/60x40/000/fff&text=3" alt="image 1"/></a>
</div>
...
<div class="image-2">
<img src="http://dummyimage.com/600x400/f00/fff&text=2">
</div>
<div id="thumbs" class="mouseover">
<a class="thumb-image-2" id="thumb_1" href="http://dummyimage.com/600x400/f00/fff&text=1" title="1"><img src="http://dummyimage.com/60x40/f00/fff&text=1" alt="image 1"/></a>
<a class="thumb-image-2" id="thumb_2" href="http://dummyimage.com/600x400/f00/fff&text=2" title="2"><img src="http://dummyimage.com/60x40/f00/fff&text=2" alt="image 1"/></a>
<a class="thumb-image-2" id="thumb_3" href="http://dummyimage.com/600x400/f00/fff&text=3" title="3"><img src="http://dummyimage.com/60x40/f00/fff&text=3" alt="image 1"/></a>
</div>
<script>
$(function() {
$(".mouseover a").mouseover(function(){
var src=$(this).attr('href');
var classs=$(this).attr('class');
classs=classs.substr(6);
$('.'+classs).find('img').attr('src',src);
})
})
</script>
Need your kind assistant
You can use "transform: scale()"
.mouseover img{
transition: transform 1s;
}
.mouseover img:hover {
transform: scale(2);
}
<html>
<head></head>
<body>
<div id="thumbs" class="mouseover">
<a class="thumb-image-1" id="thumb_1" href="http://dummyimage.com/600x400/000/fff&text=1" title="1"><img src="http://dummyimage.com/60x40/000/fff&text=1" alt="image 1"/></a>
<a class="thumb-image-1" id="thumb_2" href="http://dummyimage.com/600x400/000/fff&text=2" title="2"><img src="http://dummyimage.com/60x40/000/fff&text=2" alt="image 1"/></a>
<a class="thumb-image-1"id="thumb_3" href="http://dummyimage.com/600x400/000/fff&text=3" title="3"><img src="http://dummyimage.com/60x40/000/fff&text=3" alt="image 1"/></a>
</div>
</body>
<html>
Or, if you want to change the imge instead to use "scale()", you can change the HTML structure like this:
.mouseover .thumb-image:hover .small {
display: none;
}
.mouseover .thumb-image:hover .big {
display: inline-block !important;
}
.display-none {
display: none;
}
<html>
<head></head>
<body>
<div id="thumbs" class="mouseover">
<a class="thumb-image thumb-image-1" id="thumb_1" title="1">
<img class="small" src="http://dummyimage.com/60x40/000/fff&text=1" alt="image 1"/>
<img class="big display-none" src="http://dummyimage.com/600x400/000/fff&text=1" alt="image 1"/>
</a>
<a class="thumb-image thumb-image-1" id="thumb_2" title="2">
<img class="small" src="http://dummyimage.com/60x40/000/fff&text=2" alt="image 1"/>
<img class="big display-none" src="http://dummyimage.com/600x400/000/fff&text=2" alt="image 1"/>
</a>
<a class="thumb-image thumb-image-1"id="thumb_3" title="3">
<img class="small" src="http://dummyimage.com/60x40/000/fff&text=3" alt="image 1"/>
<img class="big display-none" src="http://dummyimage.com/600x400/000/fff&text=3" alt="image 1"/>
</a>
</div>
</body>
</html>
I'm adding custom social media icon links on my website (Wordpress) and there is a stubborn line that runs through them just like hyperlinks. The line disappears when mouse hovers over image, just link other hyperlinks on page.
This is the code used to create them:
.custom-social img {
text-decoration: none;
margin-right: 20px;
}
<div class="custom-social">
<a href="http://twitter.com/mrsideproject">
<img title="Twitter" alt="Twitter" src="http://coinpages.co/wp-content/uploads/2018/01/twitter-badge.png" width="35" height="35" />
</a>
<a href="http://medium.com/#mrsideproject">
<img title="Medium" alt="Medium" src="http://coinpages.co/wp-content/uploads/2018/01/medium-logo.png" width="35" height="35" />
</a>
<a href="http://instagram.com/mrsideproject">
<img title="Instagram" alt="Instagram" src="http://coinpages.co/wp-content/uploads/2018/01/Instagram-badge.png" width="29" height="30" />
</a>
</div>
The text-decoration is on the a, not the img.
Add text decoration in anchor tag. Use Css:
.custom-social a {
text-decoration: none;
margin-right: 20px;
}
Just as Daniel said, text-decoration:none is supposed on the anchor tag.
.custom-social a {
text-decoration: none;
}
.custom-social img{
margin-left:20px;
}
<div class="custom-social">
<a href="http://twitter.com/mrsideproject">
<img title="Twitter" alt="Twitter" src="http://coinpages.co/wp-content/uploads/2018/01/twitter-badge.png" width="35" height="35" />
</a>
<a href="http://medium.com/#mrsideproject">
<img title="Medium" alt="Medium" src="http://coinpages.co/wp-content/uploads/2018/01/medium-logo.png" width="35" height="35" />
</a>
<a href="http://instagram.com/mrsideproject">
<img title="Instagram" alt="Instagram" src="http://coinpages.co/wp-content/uploads/2018/01/Instagram-badge.png" width="29" height="30" />
</a>
</div>
OK, I figured it out! not entirely sure why text-decoration wasn't having any effect but this did the trick:
.custom-social a {
border:0;
}
This is my code:
<a target="_blank" href="http://weknowyourdreams.com">Family</a>
<img src="http://weknowyourdreams.com/images/family/family-02.jpg" height="140" width="300">
</a>
<a target="_blank" href="http://chess.com">Chess</a>
<img height="140" width="300" alt="Chess game" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/ChessSet.jpg/647px-ChessSet.jpg">
</a>
<a target="_blank" href="http://okcstorm.com/index.php/basketball/">Basketball court</a>
<img src="http://okcstorm.com/wp-content/uploads/2016/12/cropped-Basketball-2-1.jpg" width="300" height="200">
What I want to achieve is to link them each to the site that I've got them from. But, the problem is the phone in the code avengers keep telling me this error:
Uncaught TypeError: Cannot read property 'ClearPromptText' of null
I don't know what that means, please help.
.image-f{
float:left;
display:block;
margin-right:10px;
width:300px;
}
.image-f img{
float:left;
width:100%;
height:140;
}
<a target="_blank" class="image-f" href="http://weknowyourdreams.com/" >Family
<img src="http://weknowyourdreams.com/images/family/family-02.jpg" >
</a>
<a target="_blank" class="image-f" href="http://chess.com">Chess
<img alt="Chess game" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/ChessSet.jpg/647px-ChessSet.jpg">
</a>
<a target="_blank" class="image-f" href="http://okcstorm.com/index.php/basketball/">Basketball court
<img src="http://okcstorm.com/wp-content/uploads/2016/12/cropped-Basketball-2-1.jpg" ></a>
<a href="service.html">
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Sea Freight.png"/>
</a>
<a href="airfreight.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Air Freight.png">
</a>
<a href="projectcargo.html">
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Project Cargo.png">
</a>
<br/>
<a href="customclearance.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Custom Clearance.png">
</a>
<a href="transportation.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Domestic Transportation.png">
</a>
<a href="thirdparty.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Warehousing and Distribution.png">
</a>
</br>
<a href="coastalcargo.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Coastal Cargo.png">
</a>
<a href="veseelchartering.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Vessel Chertring.png">
</a>
</br>
I have create button by using img tag within anchor.
why I am getting small dash at right corner??
thanks in advance
There is a default text-decoration:underline associated with an anchor <a> tag. Since there is a space in the <a> </a>, that underline is the line you see.
Use text-decoration:none on <a>, that should solve it.
a {
text-decoration: none;
}
This appears to happen when:
the closing anchor tag is on a separate line from the rest of the element
AND the visible text of the anchor is an image
AND you have multiple images on the same line
and also the anchor/image is not the last item in the horizontal series
In the following example, you will not see dashes after the third and fifth images, but the other images will show a dash to the right of the image/link:
<p>
<a href="#">
<img src="image.jpg" alt="Test 1" />
</a>
<a href="#"><img src="image.jpg" alt="Test 2" />
</a>
<a href="#">
<img src="image.jpg" alt="Test 3" /></a>
<a href="#"><img src="image.jpg" alt="Test 4" />
</a>
<a href="#"><img src="image.jpg" alt="Test 5" />
</a>
</p>
I can't find any information to say if this is a violation of an HTML rule regarding splitting elements across multiple lines. I replicated the same issue in Chrome, Firefox and IE 11.
I can only guess that a space is being added after the image, since the closing tag is on a separate line. And this relates to the answers given above - the space is being automatically styled with an underline. But I don't know why the space is added after an image but not after text, or why this only happens when the images are on the same line.
<a> is an inline element. If you leave space between enclosed elements and the </a> element, it will be formatted automatically which is with an underscore.