Safari won't read .class img {} CSS - html

This problem ONLY happens on Safari, all other browsers i've checked and they work fine (Opera, Chrome, Firefox).
I basically have a large list of small images used as links to different church websites. They are listed like so:
<div class="church"><img src="images/logos/antioch.png" style="width: 150px;" /><div class="caption"><br>Antioch House<br>Location</div></div>
And the CSS is as follows:
.church {
overflow: hidden;
position: relative;
display: inline-block;
width: 150px;
height: 70px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
border-style: solid;
border-width: 1px;
border-color: #000;
}
.church img {
width: 150px;
}
I would like every image to be equal in length, so that if anyone was to add a new image, it would automatically size the logo to fit within the .church class div.
But for some reason, Safari (The only browser to do this) won't recognise the width I am trying to give to the .church img element. If I add style="width: 150px;" to the img tag in the index.html file, it works. But I feel like a disgraceful person to write that into 40 individual tags.
Perhaps i've just made a mistake somewhere that safari won't tolerate. (I am mostly a designer, so i do tend to make coding mistakes a lot)
Thanks for any help!

Related

HTML text not aligning properly

I have a textbox and when I enter the term "laptop" its not visible properly. The problem is in IE9, not with Chrome.
HTML
<input id="small_search_string_sub" name="search_string" type="text" class="newsearch_sub rounded " placeholder="Search..." maxlength="500">
Here is the CSS:-
.newsearch_sub {
padding: 3px 10px 3px 10px;
background-color: #FFF;
width: 220px;
height: 25px;
margin-top: 10px;
vertical-align: top;
}
It seems like you have no reset for the input default style, also the input has not format for the text on it, also the padding might be pushing down the text to far.
I tried this, and it seems to work well on IE9 for me, but the fact that I see another class (rounded) on the line of code that you send, makes me wonder if there is not something missing here, can you put a link to the code, even as a stand alone page, this way I can debug on ie9 on the proper code, and maybe give you a solution if this one does not work for you.
.newsearch_sub {
padding: 3px 10px 3px 10px;
background-color: #FFF;
width: 220px;
height: 25px;
margin-top: 10px;
vertical-align: top;
font:12px/24px Arial,Helvetica
}

border-image driving me crazy

It seems I must have read every article and guide to using border-image that there is on the web, and have tried just about every suggestion possible, yet it still isn't displaying! It's destined for a ul of class "navbox", and the full CSS for that element is below.
ul.navbar {
float: right;
list-style-type: none;
background-color: #F8F8F8;
border-style: solid;
border-width: 4px;
border-color: #231F20;
color: #1F1F1F;
margin: 25px 5px 5px 5px;
height: 50px;
position: absolute;
left: 450px;
right: 20px;
vertical-align:middle;
border-image-source: url(C:\Users\imamadmad\Documents\Web Stuff\Locomotion Coffee\border.png);
border-image-outset:4px;
border-image-width:4px;
border-image-slice:8;
border-image-repeat:repeat;
}
I feel I have tried every possible combination of the border-image property, and even used both a .png and a .jpg version of the file, yet nothing displays. I've even removed the other border styling completely, but replaced it when that didn't make the border-image appear as I still needed some sort of border! I'm not sure if it would have anything to do with the fact that I'm calling the entire document and all files associated with it through my computer rather than through the web, as I need to make a mock-up on my own computer before I can put it online. However, everything else, including other images, are displaying just fine. It is neither displaying in Chrome nor IE, and Firefox just doesn't want to show any CSS at all, so that's unhelpful. I have tried adding the -webkit- etc. tags to the properties, but they made no difference either and besides, it shouldn't need it for the latest version of Chrome, which I'm running.
Please, can anyone help me! While it's not vital to the design, it would really just make it that much easier on the eyes.
Works fine. Check your image url
FIDDLE DEMO
ul {
float: right;
list-style-type: none;
background-color: #F8F8F8;
border-style: solid;
border-width: 4px;
border-color: #231F20;
color: #1F1F1F;
margin: 25px 5px 5px 5px;
height: 50px;
position: absolute;
left: 450px;
right: 20px;
vertical-align:middle;
border-image-source: url(http://i46.tinypic.com/10gljba.jpg);
border-image-outset:2px;
border-image-width:4px;
border-image-slice:8;
border-image-repeat:repeat;
}
Hope this is what you are looking for
Edit : FIDDLE Updated

odd text behavior in chrome/IE 11/ firefox

I am encountering a peculiar text behavior with different browsers. I cannot say which browser of the 3 is acting peculiar. Before I give out the details of my problem let me illustrate the issue I am encountering..
Outputs::
layout format::
Now the corresponding css codes are as follows::
#feature_links_inner_block {
width: 205px;
height: 390px;
margin: 0 auto;
}
#side_nav_links {
width: 99%;
height: 375px;
margin: 0 auto;
}
.one_third_side_nav_block {
width: 100%;
height: 125px;
}
.one_third_side_nav_block h4 {
margin: 3px 0px 0px;
padding: 0;
font-family: "marcellus sc";
font-size: 19px;
color: #f1d000;
text-align: center;
}
.one_third_side_nav_block img {
float: left;
margin: 1px 3px 0px 1px;
}
.one_third_side_nav_block p {
margin: 3px 0px 5px 0px;
font-family: "trebuchet ms",Arimo, sans-serif;
font-size: 14px;
color: #fff;
}
HTML::
<div id="feature_links_inner_block">
<div id="side_nav_links">
....
<a href="news_media_blurbs.html">
<div class="one_third_side_nav_block white_bottom_border">
<h4>News, Media & Blurbs</h4>
<img src="../Images/png/apply.png" alt="News and Media image" />
<p>What is happening now?</p>
</div>
</a>
...
</div>
</div>
I am trying to figure out what is causing this to happen. Its the same code but rendered different. I have tried to look at the computed values in each browser but they all seem to be the same. If anyone wants it i have the computed values of chrome and firefox copied as a text file.
Ideally I want the final output to look like the chrome output. This is just a small part of the page. I have other sections in the page which runs into similar issue.
Is chrome rendering correctly and the rest 2 not? or is it the other way around?
Any help is appreciated. Thanks in advance
Addendum::: I forgot to mention that I am using HTML5-Boilerplate as my template
The issue here was that the div containing the H4 element was not rendering with a large enough width in Chrome to display the H4 on a single line and the text was wrapping. The OP said that this was actually the desired effect, so I suggested manually adding in a line break to force the H4 to break at the desired point.
If the OP had wanted the H4 to remain on one line, they could have, alternatively, reduced the font-size by a point or two to allow the H4 enough room to exist on one line across all browsers.
This ended up working for the OP:
<h4>News, Media &<br/>Blurbs</h4>

Background Image shows in Firefox and Chrome but NOT IE9

I have a header that has an image in the background and it is not showing up in IE9. It works fine in Chrome, Firefox, and Safari. The logo file that is opened in the header displays fine.
HTML:
<div class="myheader">
<img src="img/logo.png"><h5 class="your-on">You are on: Login Page</h5>
</div>
CSS:
.myheader {
height: 90px;
/* background-color: #3D8F43; */
padding: 5px;
position: relative;
border-radius: 10px;
-moz-border-radius:10px;
background-image: url("../img/header-bg.jpg");
}
Also, I am simply opening these files locally with whatever browser I want to open it with. It is a demo that I need to email different people and have them open it and view the HTML files so I need it to work locally.
I have already enabled mix content on the settings in IE but it didn't work.
Update - Should have included this first. When I first open the page IE states that it has restricted the webpage from running scripts or ActiveX controls. I allow it to do this and refresh the page but with the same result, no image.
Try this:
.myheader {
height: 90px;
/* background-color: #3D8F43; */
padding: 5px;
position: relative;
border-radius: 10px;
-moz-border-radius:10px;
background: url(../img/header-bg.jpg) no-repeat 0 0;
}
Take out the quotes on the background-image as well as the "-image". See if that works for you ;)
Also, specify the image you have within the class. So try adding:
.myheader img { /* === Specify what your inner image/logo would be --- */
width: 50px;
height: 50px;
position: absolute;
top: 0;
left: 0;
}
HTML:
<div class="myheader">
<img src="img/logo.png" alt="" title="" /><h5 class="your-on">You are on: Login Page</h5>
</div>
I am not sure why it's happening to you. So i fiddled it out and here's the code(It's the same as yours, only the images are some images that i got from internet) :
HTML :
<div class="myheader">
<img src="https://www.key.com/kco/images/logo.png"/>
<h5 class="your-on">You are on: Login Page</h5>
</div>
CSS:
.myheader {
height: 90px;
/* background-color: #3D8F43; */
padding: 5px;
position: relative;
border-radius: 10px;
-moz-border-radius:10px;
background-image: url("https://www.key.com/kco/images/bg_nav-rht.png");
}
The screenshot looks like this :
The logo is the one containing the keybank string and the background is the one with red and grey color in it.
Here's the fiddle : http://jsfiddle.net/pLkbV/2/
I have tested it on IE 9 and 10 and it worked flawlessly.
So , a possible reason in your case might be that the image is not getting loaded from the path that you have provided in the background URL.

border:none not working on an image set using background

K so I have an image in my html and I am settings its src using css and background: url() the reason for this is because I want to toggle the class on click so that I go back and forth between images. Everything works except for the fact that my image has a border and nothing I do seems to get rid of the stupid thing.
Here is the html:
<img class="minus" />
and here is the css:
.minus{
position: relative;
margin: 0 0 -3px 5px;
float:right;
background: url(/images/mobile/minus.png) no-repeat;
border: none;
display:block;
width: 16px;
height: 16px;
}
I have tried everything I can think of border:0px; border:0; border-width: 0px; border-style:none; anything I could find on here or on the web basicly and nothing will get rid of the stupid border. Any insight would be appreciated.
Edit: using google chrome.
I'm certainly able to reproduce this error in Chrome. Here's a demo:
.minus{
display: block;
margin: 0 0 -3px 5px;
background: url('http://www.google.com/intl/en_com/images/srpr/logo3w.png');
width: 100px;
height: 100px;
}
<img class="minus">
However, w3.org specifies (emphasis mine):
The SRC attribute specifies the URI for the image to be embedded. Its syntax is the same as that of the HREF attribute of the tag. SRC is mandatory.
Setting a CSS background-image is not the same as setting the src HTML attribute of <img>... and perhaps that's your problem. You should consider using a different element, e.g.: a <span>:
.minus {
display: block;
margin: 0 0 -3px 5px;
background: url('http://www.google.com/intl/en_com/images/srpr/logo3w.png');
width: 100px;
height: 100px;
}
<span class="minus"></span>
Here is a fiddle that uses a div with the class (I see no border). When I try an img with the class, it shows nothing (in firefox 7)