Wordpress CSS image autoresponsive - css

The following image demonstrates what I'm trying to accomplish.
The A) it's on webbrowser of computer, which displays cool. The B) it's on mobile devices or small screens. I would like to make the images appear on mobile devices like the A).
I'm attempting this on Wordpress in the header.php. I've been searching and I've got this:
<a href="http://url">
<img src="http://urlIMAGE" width="100px" height="95px" style="max-width: 100%; height: auto;"/></a>
<a href="url" target="_blank">
<img src="http://urlIMAGE" width="100px" height="95px" style="max-width: auto; height: auto;"/></a>
But it's not working.

a img{width:100%; float:left;}

You could use some thing like:
float: left;
or
float: right;
inside your style attribute. See if that works.

Related

Social Media Icons in Footer

I use wordpress and want to add social media icons to my footer. What I did so far is to add the following code to the footer.php:
<div id="social-buttons">
<a href="http://twitter.com/veda_vit" rel="me"><img title="veda-vit.de bei Twitter" src="http://veda-vit.de/wp-content/uploads/2017/11/Twitter.svg" alt="Twitter Button" width="24" height="24" />
</a>
<a href="https://www.facebook.com/vedavit.de" rel="me"><img title="veda-vit.de bei Facebook" src="http://veda-vit.de/wp-content/uploads/2017/11/Facebook.svg" alt="Facebook Button" width="24" height="24" />
</a>
</div>
And additionally I added the following css code to place the icons on the right:
#social-buttons a img {
margin: 10px 12px 0 0;
float: right;
}
It works so far, but the icons are placed on a second line (see here: www.veda-vit.de).
What can I do to place the copyright and the icons on one line? I tried already everything, but couldn't solve the problem. Can anybody help me, please?
Thank you!
You can add this CSS code and it will work nicely
#social-buttons {
float: right;
position: relative;
top: -9px;
}
You can edit it more by changing top position.

Twitter Bootstrap is screwing up my imagemap - Anyone else have this issue?

First off - this is my first question ever (I'm still a beginner) and I can't say how much I appreciate this site and all the help I've found on here. Hopefully every question I ask can help someone else too :)
I realize not many people use imagemaps any more but I have one and twitter bootstrap (version 3.0.0) is screwing up my coordinates - putting the links in the wrong places. I can make it work with the following code but then it wont resize to fit the screen. Any tips?
<style>
<!Driving me nuts - without this the imagemap links are in the wrong places - with this it wont resize>
#img_ID {
max-width:none;
width:auto;
display: inline;
}
</style>
Here is a snippet of the actual imagemap code
<div style="width:100%">
<img id="img_ID" src="NewMatGuide.png" USEMAP="#map" border="0" class="" width:100% alt="">
</div>
<Map id="map_ID" name="map">
<AREA shape="RECT" COORDS="80,151,258,252" HREF="PlacementResults.php?ChosenArea=A">
<AREA shape="RECT" COORDS="80,328,258,432" HREF="PlacementResults.php?ChosenArea=B">
<AREA shape="RECT" COORDS="80,521,258,620" HREF="PlacementResults.php?ChosenArea=C">
I'd recommend, rather than an image map, make 3 divs that are links with the following HTML and accompanying CSS.
<div id="box_a">
<a class="box_link" href="PlacementResults.php?ChosenArea=A"></a>
</div>
<div id="box_b">
<a class="box_link" href="PlacementResults.php?ChosenArea=B"></a>
</div>
<div id="box_c">
<a class="box_link" href="PlacementResults.php?ChosenArea=C"></a>
</div>
Use percentages to define the coordinates. Given that your X1 and X2 coordinates are the same for the links in your image map, the following example (with different %s to actually cover your image correctly) should work.
#box_a, #box_b, #box_c {
margin-left: 10%;
margin-top: 5%;
height: 15%;
width: 25%;
}
.box_link {
display: block;
height: 100%;
width: 100%;
}
You should check out this page to learn more about making div links. I would also suggest using NewMatGuide.png as a background-image and define the size of #img_ID.

Unorder list mix up in coding?

Something is definetly wrong with my ul and li. I know I made a huge mistake but I cannot find it. When you go here:
http://icpy.webs.com/text/Mass.htm
You will see both thumbnail images are different but both pop ups have the same bigger image as the first thumbnail.
Why are these before doctype? What are those custom elements?
<link rel="stylesheet"type="text/css"href="../text/aboutleft.css">
<img src="http://icpy.webs.com/content/masslayout.png"/><br>
____________________________________________________________________________<br><br>
<x><re>colors available</re></x><br>
<x><gre>available to unlimited users </gre></x><br>
<x>Changes available: box, link, username</x><br><br>
Why don't you use a relative link for the masslayout.png?
Have you ever heard of the <hr> element in HTML?
I don't see any thumbnails, neither popups and I don't know what you are talking about.
jQuery is stored on Google and it is in cache for most of the users. Why do you store and link another one?
Your CSS:
.fancybox-custom .fancybox-skin {
box-shadow: 0 0 50px #222;
}
body {
max-width: 700px;
margin: 0 auto;
#cas ul {
list-style-type: none;
}
}
What is this?? What did you want?
<a class="fancybox" title="Mass Sale layouts" href="#inlineframe>
Href attribute needs a close quote mark.
Look at your source code and after that into the inspector and please correct as many errors as you can.
I think the reason it's like that, because both boxes are within the same <a>-Tag, which of course links to only one of the big images:
<a class="fancybox" title="Mass Sale layouts" href="#inlineframe">
<img src="http://dgamerhelp.webs.com/soccer/layouts/BEA01.png"/>
<div id="inlineframe" style="width: 1040px; height: 785px; display: none;">
</div>
</a>
<a class="fancybox" title="Mass Sale layouts" href="#inlineframe">
<img src="http://dgamerhelp.webs.com/soccer/layouts/JAK01.png"/>
<div id="inlineframe" style="width:1040px;height:785px;display: none;">
</div>
</a>

Is it possible to resize all images on a page to a specific size?

I am creating an email flyer and I have multiple images that I want at 140px by 140px but some are originally 300x300 or 400x400. I don't want to go resize each image as there can be quite a few and the flyer will be a weekly update so is it possible to use CSS to tell all images (or images that have classes) to resize to 140px?
I was going to post some code but it's quite a vague request so there no relevant code I can show to help my question.
maybe if I <span>...</span> and then give the span a class, would it be possible this way?
if your markup is for a newsletter you may force dimensions both with style attribute and with inline width and height attribute, e.g.
<img src="..." style="width:140px; height:140px" width="140" height="140" />
but, anyway, I strongly suggest to perform some kind of batch task for automatic resize of the images (e.g. using GruntJS), so you could save some precious bandwidth on the server in which you store your static assets. (conversely, if you embed images into the email, users will appreciate a lighter size)
Yeah add class to span and then:
span.yourclass img {
width: 140px;
}
I think I might be understanding this, but some simple css should work :
css :
img.small {
width: 140px;
height: 140px;
}
OR if you want to do all img's under a specific element :
.thumbs img {
width: 140px;
height: 140px;
}
html :
<img src="pic.jpg" class="small">
<div class="thumbs">
<img src="pic.jpg">
<img src="pic.jpg">
<img src="pic.jpg">
</div>
Or if they are dynamically generated, you can eliminate the css and just go :
<img src="pic.jpg" width="140" height="140">
You can set width and height for all images. Add "max" keyword to be sure.
img{
max-width:140px !important;
max-height:140px !important;
}
If you simply want ALL images on the page to resize, add the following into your CSS:
img{ width: 140px; }
This will proportionally set the height/width and I'm assuming all you images are square ?
If not, add 'height: 140px' but this will distort an image that isn't square.
wrap your images with div.class then write a single css to resize all the images which are wrapped by that div
MARK-UP::
<div class="imageWrapper">
<img src="/path/to" />
<img src="/path/to" />
<img src="/path/to" />
</div>
CSS::
.imageWrapper{
overflow:hidden;
}
.imageWrapper img{
width:400px;
height:400px;
}

css and master page asp.net problem

i had used the following code in master page of asp.net project
<a runat="server" href="home.htm" onmouseover="document.Home_Img.src='Images/home_2.png'"
onmouseout="document.Home_Img.src='Images/home.png'">
<img alt="" src="Images/home.png" name="Home_Img" runat="server" />
</a>
It is working well for all associated webforms in the root directory but not in the sub directory pages.
any sugesstion would be respected.
Thnx in advance...
You're using a relative URL Images/home.png for the image location, change it to absolute /Images/home.png:
<a runat="server" href="home.htm" onmouseover="document.Home_Img.src='/Images/home_2.png'"
onmouseout="document.Home_Img.src='/Images/home.png'">
<img alt="" src="/Images/home.png" name="Home_Img" runat="server" />
</a>
Also, this has nothing to do with CSS since you're using old school Javascript mouseovers. I would strongly suggest you change it to something like:
<style>
a.home {
background: url(/Images/home.png) no-repeat;
display: block; /* this may not be correct, depends on the layout */
height: 100px; /* height of image */
text-indent: 9999px;
width: 100px; /* width of image */
}
a.home:hover {
background: url(/Images/home_2.png) no-repeat;
}
</style>
<a class="home" href="home.htm">Home</a>
Put the URL's of your wrapped in the ResolveUrl like so:
<a runat="server" href="<%= this.ResolveUrl("home.htm") %>" onmouseover="document.Home_Img.src='<%= this.ResolveUrl("Images/home_2.png") %>'"
onmouseout="document.Home_Img.src='<%= this.ResolveUrl("Images/home.png") %>'">
<img alt="" src="Images/home.png" name="Home_Img" runat="server" />
</a>

Resources