I have a select box styled for good browsers, and for ie9 and down, I wish to have the default select box displayed, with no custom styles.
Styles for good browsers:
select {
display: inline-block;
background: transparent;
padding: 5px;
font-size: 16px;
line-height: 1.3;
border: 0;
border-radius: 0;
height: 40px;
-webkit-appearance: none;
-moz-appearance: none;
}
/*ie-10 fix*/
select.select-k::-ms-expand {
display: none;
}
select.select-k {
font-family: Bitter, Georgia, serif;
font-weight: 700;
border: none;
padding-left: 20px;
}
select.select-k.quantity {
width: 80px;
background: url(../img/forms/arrow.png) no-repeat 80% 50% #fff;
}
Now I have the following conditional:
<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="/css/bugbrowser.css" />
<![endif]-->
My question is, in order to overwrite those styles on IE, should I redeclare all values? If so, where can I see the default IE styles to overwrite?
Considering that IE 10 and higher don't support conditional comments, why not write something like this:
<!--[if !IE]><!-->
<link rel="stylesheet" type="text/css" href="/css/styles.css">
<!--<![endif]-->
Or if you persist on using inline styles:
<!--[if !IE]><!-->
<style>
select {
display: inline-block;
background: transparent;
padding: 5px;
font-size: 16px;
line-height: 1.3;
border: 0;
border-radius: 0;
height: 40px;
-webkit-appearance: none;
-moz-appearance: none;
}
/*ie-10 fix*/
select.select-k::-ms-expand {
display: none;
}
select.select-k {
font-family: Bitter, Georgia, serif;
font-weight: 700;
border: none;
padding-left: 20px;
}
select.select-k.quantity {
width: 80px;
background: url(../img/forms/arrow.png) no-repeat 80% 50% #fff;
}
</style>
<!--<![endif]-->
So let's say you create a new file that you only want to display on modern browsers, (including IE10+, but not IE9 and below) then you'd call that file something like: gt-ie9.css (greater than IE 9). Then, in your HTML you'd call that CSS like so:
<!--[if !IE]><!-->
<link rel="stylesheet" type="text/css" href="/path-to-file/gt-ie9.css">
<!--<![endif]-->
Related
I insert the following between the <head> tags:
<link rel="stylesheet" type="css/stylesheet" href="fileadmin/css/konsensusempfehlung.css">
This stylesheet does affect my HTML code in Firefox.
However in IE11 it does not.
konsensusempfehlung.css:
tr.hauptzeile {
background-color: #FFFFFF;
text-align: left;
}
tr.tr-even{
background-color: #edf7f9;
}
th {
padding: 0.5em;
}
td.td-0 {
font-weight: bold;
}
td {
padding: 0.5em;
}
.table-scrollable {
width: 100%;
overflow-y: auto;
margin: 0 0 1em;
}
.table-scrollable::-webkit-scrollbar {
-webkit-appearance: none;
width: 14px;
height: 14px;
}
.table-scrollable::-webkit-scrollbar-thumb {
border-radius: 8px;
border: 3px solid #fff;
background-color: rgba(0, 0, 0, .3);
}
How do I fix this?
Use the proper type.
<link type="text/css" rel="stylesheet" href="yourLink">
You need to change the value of the type attribute from "css/stylesheet" to "text/css".
Please try this type
<head>
<link rel="stylesheet" type="text/css" href="konsensusempfehlung.css" />
</head>
OR if you want to target only IE, Then try this.
<head>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="konsensusempfehlung.css" />
<![endif]-->
</head>
Let me know further clearification
Should use text/css in link type. Also set href to your link . Shouldn't be a browser issue though
My site works fine with chrome nad firefox but appereantly it doesn't show submit button properly with Internet Explorer 11.
Can someone please check what is wrong
This is the style.css code for button:
#searchsubmit {
font-family: Frutiger, Lato;
background: url('images/search.png');
cursor: pointer;
width: 30px;
height: 30px;
border: 0px;
float:right;
margin-top:5px;
}
.searchform input, .searchform input#s, placeholder {
font-family: Frutiger, Lato;
background: #4D6B87;
height: 30px;
border: 0px;
color: #EAEAEA;
font-size: 14px;
padding-left: 5px;
}
all style.css is available here: www.virmodrosti.com/wp-content/themes/virmodrosti/style.css
First Solution :
I found a way but you'll have to use Internet Explorer's conditional comment, this will resolve your issue, do it like so :
<!--[if IE]>
<style>
#searchsubmit {
position:absolute;
right:20px;
}
</style>
<![endif]-->
Second solution :
I am not sure about this one since I don't use internet explorer anymore so I couldn't test it, but maybe if you simply add :
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
It will emulate as edge on Internet Explorer 11 only, but you'll have to try.
Try this code :
.searchform#searchform input, .searchform#searchform button {
display: inline-block;
float: none;
vertical-align: middle;
margin: 0;
}
.searchform#searchform input {
width: calc( 100% - 40px );
margin-right: -2px;
}
.searchform#searchform button {
width: 30px;
margin-left: -2px;
}
Ck-editor works itself good, after i save editet text from ckeditor to database, and then i load it to page. Generated html is unformated, is there any aditional ckeditor js functions that have to be applied to target area, or is there any detault class needed to be added to text container ?
I checked ck-editor css files but there is no specific class, like when you check "contents.css" in ckeditor files and there is "img.left{border: 1px solid #ccc; .." thats pretty creepy since there is no specific class, it would work in plain iframe but if i show text from ckeditor in more complex page i have to rewrite css like ".wysiwyg img.left" and then reset all css by modified reset.css for .wysiwyg class, and its pretty hard to reset everything, isnt there some other way that i just missed badly in ck-editor documentation? since all i see in there are only examples in actual editor, not how to style generated text itself.
If you just want the HTML authored in CKEditor to look the same inside your page, first you must insert it inside a div element with a custom class, for example, "my-container".
Then you have to include contents.css in your page. Here you have to alternatives: 1) use Scoped Stylesheets or 2) modify contents.css, scoping each rule.
1. Using Scoped Stylesheets
In this case you should use Scoped Stylesheets and JQuery Scoped CSS plugin (due to current lack of browser support).
Your HTML code would look like this:
<div class="my-container">
<style scoped>
#import "ckeditor/contents.css";
</style>
<!-- Your HTML goes here -->
</div>
2. Scoping each rule inside contents.css
In this case you must link to a modified copy of CKEditor's contents.css file. Each of the rule's selector must be scoped to "my-container" class, so it doesn't affect the rest of the page. Example contents.css file:
.my-container
{
/* Font */
font-family: sans-serif, Arial, Verdana, "Trebuchet MS";
font-size: 12px;
/* Text color */
color: #333;
/* Remove the background color to make it transparent */
background-color: #fff;
margin: 20px;
}
.my-container .cke_editable
{
font-size: 13px;
line-height: 1.6em;
}
.my-container blockquote
{
font-style: italic;
font-family: Georgia, Times, "Times New Roman", serif;
padding: 2px 0;
border-style: solid;
border-color: #ccc;
border-width: 0;
}
.my-container .cke_contents_ltr blockquote
{
padding-left: 20px;
padding-right: 8px;
border-left-width: 5px;
}
.my-container .cke_contents_rtl blockquote
{
padding-left: 8px;
padding-right: 20px;
border-right-width: 5px;
}
.my-container a
{
color: #0782C1;
}
.my-container ol,.my-container ul,.my-container dl
{
/* IE7: reset rtl list margin. (#7334) */
*margin-right: 0px;
/* preserved spaces for list items with text direction other than the list. (#6249,#8049)*/
padding: 0 40px;
}
.my-container h1,.my-container h2,.my-container h3,.my-container h4,.my-container h5,.my-container h6
{
font-weight: normal;
line-height: 1.2em;
}
.my-container hr
{
border: 0px;
border-top: 1px solid #ccc;
}
.my-container img.right
{
border: 1px solid #ccc;
float: right;
margin-left: 15px;
padding: 5px;
}
.my-container img.left
{
border: 1px solid #ccc;
float: left;
margin-right: 15px;
padding: 5px;
}
.my-container pre
{
white-space: pre-wrap; /* CSS 2.1 */
word-wrap: break-word; /* IE7 */
}
.my-container .marker
{
background-color: Yellow;
}
.my-container span[lang]
{
font-style: italic;
}
.my-container figure
{
text-align: center;
border: solid 1px #ccc;
border-radius: 2px;
background: rgba(0,0,0,0.05);
padding: 10px;
margin: 10px 20px;
display: block; /* For IE8 */
}
.my-container figure figcaption
{
text-align: center;
display: block; /* For IE8 */
}
Can somewhere help be, my star hacks arnt working in IE6 and 8 for these form elements I am trying to style? But it oddly works in ie7?
I tried adding the star infront of the class selector in general, which made it work in IE8 and 7, but stil not 6 and then made the * apply to firefox, safari, chrome etc. too which just means the star was applying to every browser which I don't need, just internet explorer.
Any help please?
/* FORMS */
/*SEARCH*/
#searchform .s, #searchform .but{float:left;}
#searchform .s{
background-color:rgba(128, 129, 132, 0.4);background-image: url(images/line.png);margin-bottom: 10px; border: none; padding:10px;width: 140px;
font-family: Helvetica, Arial, Sans-serif; font-size: 12px; font-weight: bold; color: #868686;
}
#searchform .but
{
background-color:rgba(128, 129, 132, 0.4); margin-bottom: 10px; border: none; padding:10px;width: 30px;
font-family: Helvetica, Arial, Sans-serif; font-size: 12px;font-weight: bold; color:#00ADEE;
}
/* IE HACK */
*#searchform .s{
*background-color:#C3C3C4;
}
*#searchform .but{
*background-color:#C3C3C4;
*height: 35px
}
/*FIREFOX btn HACK*/
#searchform .but::-moz-focus-inner {
padding: 0;
border: 0
}
/* MAILING LIST */
#mc_embed_signup #mce-EMAIL, #mc_embed_signup #mc-embedded-subscribe{float:left;}
#mc_embed_signup{margin-top: 10px;
background-image: url(images/ieblue.png); }
#mc_embed_signup #text { padding: 8px 5px 8px 8px;
font-family: Helvetica, Arial, Sans-serif; font-size: 10px; line-height: 14px; font-weight: bold; color: #FFFFFF;}
#mc_embed_signup .asterisk {color: #FFFFFF}
#mc_embed_signup #mce-EMAIL {background-color:rgba(0, 173, 238, 0.6);background-image: url(images/line2.png);
margin-bottom: 10px; border: none; padding:10px;width: 158px;
font-family: Helvetica, Arial, Sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF; }
#mc_embed_signup #mc-embedded-subscribe {background-color:rgba(0, 173, 238, 0.6); margin-bottom: 10px; border: none; padding:10px;width: 30px;
font-family: Helvetica, Arial, Sans-serif; font-size: 12px;font-weight: bold; color:#FFFFFF;
}
/* IE HACK */
* #mc_embed_signup #mce-EMAIL{
*background-color:#60c7ee;
}
* #mc_embed_signup #mc-embedded-subscribe{
*background-color:#60c7ee;
*height: 35px
}
/*FIREFOX btn HACK*/
#mc_embed_signup #mc-embedded-subscribe::-moz-focus-inner {
padding: 0;
border: 0
}
#hidemap{
display: none;}
/* DIRECTIONS */
#daddr #saddr{float:left;}
#saddr {background-color:rgba(128, 129, 132, 0.4);background-image: url(images/line.png);
margin-bottom: 0px; border: none; padding:10px;width: 158px; ;
font-family: Helvetica, Arial, Sans-serif; font-size: 12px; font-weight: bold; color: #868686;}
#saddrbut {background-color:rgba(128, 129, 132, 0.4); margin-bottom: 0px; border: none; padding:10px;width: 30px;
font-family: Helvetica, Arial, Sans-serif; font-size: 12px;font-weight: bold; color:#00ADEE;
}
*#saddr{
*background-color:#C3C3C4;
}
*#saddrbut{
*background-color:#C3C3C4;
*height: 35px
}
/*FIREFOX btn HACK*/
#saddrbut::-moz-focus-inner {
padding: 0;
border: 0
}
The star hack targets IE7 and below, which explains why it isn't working for you in IE8. I can't say why it isn't working for IE6; I thought the star hack would work for it, but since we've dropped support for IE6, I haven't had to think about it for some time, so I may not be remembering correctly.
I would like to say that using hacks like this is generally a bad idea -- nine times out of ten, if you're using a CSS hack for anything other than IE6, then you're doing something wrong. Even for IE6, it is better to use conditional comments (in fact this point applies to all versions of IE).
If you must use CSS hacks to target IE, I suggest looking at this page which gives specific hacks which you can use to target any individual combination of IE versions.
If you're targetting IE8 and below, then the \9 hack would seem to be appropriate. I would still re-iterate what I said earlier, and recommend not using hacks at all if at all possible.
Hope that helps.
[EDIT]
The reason it isn't working for you is that the star hack goes on the properties, not the selector.
So you have this:
*#searchform .s{
*background-color:#C3C3C4;
}
whereas the star hack would only want the star on the background-color line, not the #searchform selector.
[EDIT2]
More importantly, you don't actually need to use any hack here at all.
Simply specify the plain-colour fall-back version first, followed by the more advanced version, and the browsers will pick the one that works for them, according to what they support:
#searchform .s{
background-color:#C3C3C4;
background-color:rgba(128, 129, 132, 0.4);
margin-bottom: 10px; border: none;
}
See -- no hacks required. :-)
I've read a bit on those css-hacks, and boy are they messy! There is a good reference on
Wikipedia available.
I would advice you to use conditional comments in your html for IE-styling though. It keeps all your IE-specific styling in a seperate file:
<!--[if IE]>
<link href="style-ie.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if lt IE 8]>
<link href="style-below-ie8.css" rel="stylesheet" type="text/css" />
<![endif]-->
This is a complete guide about conditional comments:
http://www.quirksmode.org/css/condcom.html
Why does Firefox 4 absolutely position fieldset legends differently than other browsers?
Test page:
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8"/>
<title>Test</title>
<style type="text/css">
*
{
margin: 0;
padding: 0;
}
body
{
font-family: Tahoma, Arial, sans-serif;
font-size: 62.5%;
}
#wrapper
{
margin: auto;
padding: 1em;
width: 720px;
}
form
{
width: 670px;
padding: 25px;
background-color: #ffffff; /* White */
color: #000000; /* Black */
border: 1px solid #cccccc; /* Gray */
font-size: 12px;
}
fieldset
{
position: relative;
border: 1px solid #cccccc; /* Gray */
padding: 25px 10px 5px 15px;
margin-bottom: 20px;
}
fieldset legend
{
position: absolute;
top: 5px;
left: -10px;
/* Firefox */
/*top: -20px;
left: -25px;*/
font-weight: 900;
background-color: #ffffff; /* White */
}
/* Input Types */
label
{
margin-right: 10px;
line-height: 20px;
}
</style>
</head>
<body>
<div id="wrapper">
<form method="POST" action="test" id="testForm">
<fieldset>
<legend>Test</legend>
<label for="test">Test:</label><input type="text" id="test" name="test" value=""/>
</fieldset>
<input type="submit" value="Test"/>
</form>
</div>
</body>
</html>
Notice that in Opera 11.10 Build 2092, Chrome 11.0.696.65, Safari 5.0.4 (7533.20.27), and Windows Internet Explorer 9, they display the legend on the left, overlapping the fieldset border.
In Firefox 4.0.1, I have to change the top and left properties to get a similar effect. For example, within the style tag of the test page, uncomment this CSS:
/* Firefox */
/*top: -20px;
left: -25px;*/
legend elements are quirky and weird. That being said, if all the other browsers do the same thing, then Firefox should do the same thing.
There's already a bug report here describing the issue in detail: https://bugzilla.mozilla.org/show_bug.cgi?id=450418
A workaround is to add a wrapper div inside the fieldset and move the padding to that.
Your unchanged code: http://jsbin.com/ivedo4
Fixed code: http://jsbin.com/ivedo4/2
I tested it with the same browsers (not identical versions, but close) you listed in your question, and the rendering was consistent.
My code doesn't look quite right in IE8, but yours is broken in exactly the same way.