Im using css button generator to create the code for my css button and it generates the css code and the html code used to insert the css code. But I don't what classname to use. I tried
But that shows up blank in the website preview.
And for an offline site with minimal design would it be better to put the buttons inline? The site will be put on a CD. I'm using dreamweaver cs6.
Well i guess you will need to learn basic HTML first. Each HTML document should contain HEAD and BODY tags. In HEAD section you link your CSS file or write your generated CSS style between STYLE tags. Something like:
<style type="text/css">
.button1 {font-size:15px; color: #cccccc; ....}
.button2 {font-size:18px; padding:10px; ...}
</style>
or link your CSS file inside HTML header with:
<link rel="stylesheet" href="/css/your-stylesheet.css">
You can also check here for some basic examples of HTML and structure of HTML documents.
w3schools
With your link you just make a link to your CSS style which will open as a plain text in browser window so you don't really include it. So include CSS style in your HEAD section either by link or to put your CSS classes and everything between STYLE tags. Once you will do this "call" your style in your links like this:
Go to Google
Local file
Thanks guys. Got it to work. I found this question and answer: mmo-champion.com and it made it clear what you guys were saying.
I deleted the <style type="text/css"> and made sure that the class was = to "classname" since that was what it was called in the CSS file because it was unchanged, and then it worked. I think it didn't work because I had the class = "button1" and I also didn't delete that bit of code before.
Gantt charts & project diary
(source: css-tricks.com)
One more thing, because Internet Explorer does not support some elements which work on Chrome or FireFox, there are some special codes for including only IE CSS file (file that works only if IE is identified):
For all the IE versions, use this:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="file.css" />
<![endif]-->
For X version only:
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="file.css">
<![endif]-->
** This code can only be used for IE7. If you want to use the CSS code for other IE version, change "7" in the line !--[if IE 7> to the appropriate version number.
For IE5.5:
<!--[if IE 5.5000]>
<link rel="stylesheet" type="text/css" href="file.css" />
<![endif]-->
For IE6 and lower (including IE6), use if lte IE 6 or if lt IE 7.
For IE7 and higher (including IE7), use if gte IE 8 or if gt IE 7.
Sometimes IE blocks webpages' scripts or ActiveX controls.
To ignore IE block scripts or ActiveX controls, use this line, at the head of the HTML code.
NOT in the <head> tags, at the first line. It's important.
<!-- saved from url=(0014)about:internet -->
To read more about this error, read MOTW.
Related
I'm having two issues.
My application is not centered in IE, but looks perfect in chrome.
I have conditional just for IE, but it doesn't seem to be working. The #outline is not shifting to the left like the ie.css file is telling it to.
It is my understanding that the conditional I put in the isn't supported for IE 10 or IE 11 so what can I do so that these versions aren't ignored?
The conditional I put in
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie.css" />
<![endif]-->
You can view it in action with all the files and whatnot here: http://andrewhnovak.com/AMC%20Ticket%20Calculator%202.0/index.html
Remove the zoom: 80%' fromamc.css` line 7. That is an IE only style, and is what is messing things up.
If you were trying to accomplish something by having that there, then let me know in the comments and I'll see if I can help. But you'll notice that that shrinkage isn't happening in any other browser.
I am using this code to make HTML5 tags available to older browsers:
<script>
'header nav aside article footer section'.replace(/\w+/g, function (n) { document.createElement(n) })
</script>
Some sources say to place the code in the head section of the HTML document, and some in the body. Which way is correct?
This script needs to run before IE tries to style the elements in question to avoid the flash of unstyled content. Put it at the bottom of the head tag. See also http://en.wikipedia.org/wiki/Flash_of_unstyled_content and http://modernizr.com/docs/#installing
The most popular way to polyfill this behavior is to use the HTML5Shiv. It recommends the following:
Insert minified distribution shiv in <head> element (after or before your CSS):
<!--[if lt IE 9]>
<script src="dist/html5shiv.js"></script>
<![endif]-->
I’d recommend this shiv rather than rolling your own, as it is kept up to date with new HTML features, such as the fairly recent main element.
So I am using #font-face in my emails and Outlook 2007, 2011 and 2013 were giving me trouble. So I wrapped the #font-face CSS in conditional < !--[if !mso] > tags and this works great for CSS specific styles in outlook (desktop client) but this Completely breaks my emails in outlook.com. They come through blank as in no content! A completely white nothingness!
I've tried various forms of the outlook conditional tags such as < !--[if !mso] >
Below is my current code:
<!--[if gte mso 9]>
<style type="text/css">
#import url(http://image.commonsensemedia-email.org/lib/fea013707564077e77/m/5/csm-fonts.css);
</style>
<![endif]-->
Also below is a litmus test so you can see the results:
https://litmus.com/pub/a49f7b4/screenshots
Any reason why these emails are completely empty in outlook.com?
------UPDATE:2/18/2014 MY SOLUTION ------
This seemed to work perfectly across all platforms. Once I removed all HTML from comment tags everything worked great.
<!--[if !mso]><!-->
<style type="text/css">
#import url(http://image.commonsensemedia-email.org/lib/fea013707564077e77/m/5/csm-fonts.css);
</style>
<!--<![endif]-->
Recently, I ran into an issue with blank emails for outlook.com (#hotmail and #live) email accounts. The issue we experienced had to do with CSS comments in our inline stylesheets. Basically, what fixed the blank email experience for me was changing CSS comments to server-side comments (or deleting them entirely). If I had CSS comments like /* comment */ in our CSS, outlook.com would render blank emails.
View possible solutions here
In addition, I personally don't think its good practice to use external stylesheets in HTML emails (or email in general). It is best to add your CSS via <style></style> tags in the <head> of your template/email, or to go further and inline that same CSS to each HTML element in the email. Here's some background on why you shouldn't include external stylesheets in email:
Can you link to a CSS file from an email?
http://beaker.mailchimp.com/inline-css (manual inline tool)
http://www.benchmarkemail.com/help-FAQ/answer/Common-HTML-Email-Coding-Mistakes
Update
As #digitalmc pointed out in the comments, it seems the issue is related to having HTML in your client side comments.
I have a rails app (source) where I am trying to change fix some display bugs in Internet Explorer. In app/views/layouts/application.html.haml I have:
/[if IE]
= stylesheet_link_tag "ie", media: "all"
This seems to be generating the appropriate HTML with the precompiled asset which is downloadable from the server:
<!--[if IE]>
<link href="/assets/ie-21dfbd4e306a3f4685597c40061f9d43.css" media="all" rel="stylesheet" />
<![endif]-->
The contents of the stylesheet are simply:
#logo {
display: none;
}
When the page is displayed in IE, however, the logo still appears.
According to this page in the Microsoft Developer Network Library, conditional comments were first supported in Internet Explorer 5, and are no longer supported in Internet Explorer 10 and later.
If you are in fact not using IE10, do you have a second style sheet for non-IE browsers? Is this before or after this conditional comment in your HTML? If it is after and it contains #logo { display: block; } or similar its styles will override that of the IE specific CSS file.
I am creating a website based from tumblr that seems to work fine on google chrome, but has a issue with the ad box that I have assigned to the right of the page.
I have searched google and found this related question, but the answer given does not work for me.
I have tried the following.
Just adding a html class="ie9" tag with the proper if statements.
Clearing my cache.
And checking the browser mode.
It seems to be just one element of the page. The right side does not show up correctly, but I fiddled with the customization in IE 9 and I have the exact margin reqs. However I can't seem to link the stylesheet.
Is this because I'm linking a static file in this manner?
<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="http://static.tumblr.com/texnbv5/j70mi1pbq/ie9.css" />
Does this have anything to do with the fact that I am linking this stysheet from a different domain instead of the hosted domain?
Also is there anyway I can just single out the line that needs to be adjusted?
Is it possible for me to place a if statement in the css portion of my site
<!--[if IE 9]<style>#Content-right{margin:-1000}</style>
<![endif]-->
it's not working because you didn't close your comment tag. It has nothing to do with cross-domain css file fetching, which is entirely legal.
<!--[if IE 9]>
<link rel="stylesheet" type="text/css" href="http://static.tumblr.com/texnbv5/j70mi1pbq/ie9.css" />
should be <!-- [if IE 9] -->
Also... what engine is supposed to be acting on this IF?
There is a very interesting article on just this topic. It addresses the need/desire to isolate browser specific CSS without having to create an entire CSS file. There are also a number of benefits to the approach. I have utilized it for a number of years due to my own needs and was unaware until recently that such analysis had been performed on the technique.
Here is the link: Conditional Stylesheets vs. CSS Hacks
Other Things of Note:
Positioning of your Stylesheets is very important in CSS. Since we can't see your other calls and you are using a separate stylesheet, it is important that you place the conditional statement under your standard stylesheet.
Example
<link rel="stylesheet" href="path/to/standard.css" />
<!--[if IE 9]-->
<link rel="stylesheet" href="http://path/to/ie9.css" />
<!--[endif]-->
This is because CSS uses the styles that were loaded last if there is a conflict. I only mention this because it could be affecting you results as it is a common mistake.
Try this code
<!--[if lt IE 9]>
<link rel="stylesheet" href="http://static.tumblr.com/texnbv5/j70mi1pbq/ie9.css" />
<![endif] -->
I hope you work it