How do you apply CSS for the browse... :P
Printable View
How do you apply CSS for the browse... :P
I think its something like this.
HTML Code:<!--[if lt IE 8]>
<link rel="stylesheet" href="internetexplorer8.css" type="text/css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" href="internetexplorer7.css" type="text/css" />
<![endif]-->
pm --ss-- he knows the php one
Jack..thats called distinguishing between browsers and using different css for different browsers....
Ohh, I thought you just missed the r off ;)
If you mean where you can select which css to use:
javascript.js
page.phpHTML Code:function setActiveStyleSheet(title)
{
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
{
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title"))
{
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
}
function getActiveStyleSheet()
{
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
{
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
}
return null;
}
function getPreferredStyleSheet()
{
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
{
if(a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("rel").indexOf("alt") == -1
&& a.getAttribute("title")
) return a.getAttribute("title");
}
return null;
}
function createCookie(name,value,days)
{
if (days)
{
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name)
{
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++)
{
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
window.onload = function(e)
{
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
}
window.onunload = function(e)
{
var title = getActiveStyleSheet();
createCookie("style", title, 365);
}
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
Credit to Kristall PanelHTML Code:<head>
<style type="text/css">@import("default.css");</style>
<link href="default.css" rel="stylesheet" type="text/css" title="default">
<link href="altcss.css" rel="alternate stylesheet" type="text/css" title="altcss">
<script type="text/javascript" src="javascript.js"></script>
</head>
<body>
<a onclick="setActiveStyleSheet('default');">Default</a><br />
<a onclick="setActiveStyleSheet('altcss');">Alt Css</a><br />
</body>
CSS:
Button:Code:input.browse{
color:#050;
font-family:'trebuchet ms',helvetica,sans-serif;
font-size:small;
font-weight:bold;}
HTML Code:<input type="button" value="browse" class="browse" />
Oh, you could of said browse button :l
He means the browse button, where you use:
Im not sure to be honest.Code:<input type="file" />
Yes, yes I do blob, colin that is for a submit button ;/.
Give me the code for your Browse Button it's basically the same.
Quote:
<input type="file" value="browse" class="browse" />