PDA

View Full Version : CSS on the Browse...



Hypertext
05-03-2008, 12:16 AM
How do you apply CSS for the browse... :P

Moh
05-03-2008, 01:59 AM
I think its something like this.


<!--[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]-->

LegendOfNoob
05-03-2008, 02:57 AM
pm --ss-- he knows the php one

Hypertext
05-03-2008, 05:02 AM
Jack..thats called distinguishing between browsers and using different css for different browsers....

Moh
05-03-2008, 02:08 PM
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


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);



page.php


<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>


Credit to Kristall Panel

Colin-Roberts
05-03-2008, 02:53 PM
CSS:


input.browse{
color:#050;
font-family:'trebuchet ms',helvetica,sans-serif;
font-size:small;
font-weight:bold;}


Button:


<input type="button" value="browse" class="browse" />

Moh
05-03-2008, 02:59 PM
Oh, you could of said browse button :l

Blob
05-03-2008, 05:08 PM
He means the browse button, where you use:


<input type="file" />

Im not sure to be honest.

Hypertext
05-03-2008, 09:18 PM
Yes, yes I do blob, colin that is for a submit button ;/.

Colin-Roberts
05-03-2008, 10:07 PM
Give me the code for your Browse Button it's basically the same.

<input type="file" value="browse" class="browse" />

Hypertext
05-03-2008, 10:42 PM
<input id="clientname" name="uploadedfile" type="file" />

I used clientname as it was already css'd :P and the file box works, but the browse BUTTON
does not take the same look as ex the submit button with all the same css.

php.net
05-03-2008, 10:47 PM
Yes, yes I do blob, colin that is for a submit button ;/.
<input id="clientname" name="uploadedfile" type="file" />

I used clientname as it was already css'd :P and the file box works, but the browse BUTTON
does not take the same look as ex the submit button with all the same css.

You're the most ignorant person who has the cheek to ask for 'help' around here.

Hypertext
05-03-2008, 11:26 PM
.. ;/ hmm.. please explain :S

php.net
06-03-2008, 04:16 PM
.. ;/ hmm.. please explain :S

You don't even bother to thank people for their efforts, instead you just use ';/' and '...'.

Show respect to people who try to help and don't be such a stuck up *****.

Want to hide these adverts? Register an account for free!