Showing posts with label Css. Show all posts
Showing posts with label Css. Show all posts

Sunday, 4 March 2012

all css hacks

I am not going to use your lots of time. css hacks as below as per browser you can see results on this page by browsing this page on diffrent browsers:

stylesheet below is editable, but not in ie less than IE9
Text color in this box will change according to your browser you are using


Hack for IE6 only:
* html .color {color: red;}


Hack for IE7 only:
*:first-child+html .color {color: green;}


You can also use IE7 specific hack like below:

@media \0screen { .color {color: #blue; }



Text color in this box will change according to your browser you are using

hack for upto IE9 version
.color {color: #orange\9;}


saf3+, chrome1+
@media screen and (-webkit-min-device-pixel-ratio:0) { #color { color: red } }



/* iPhone / mobile webkit */
@media screen and (max-device-width: 480px) { #veintiseis { color: red } }



Sunday, 17 July 2011

cover background automatically


just give this style to your component to give a background that will cover background automatically.

{
background: url(images/bg.jpg) no-repeat center center fixed;
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
}

Using Max & Min width in IE6

Min & Max width are both great tools to have in your design arsenal, but unfortunately they don’t work in IE6, so what do we do?
We usually lock down the width of our site instead of creating the ideal fluid layout we want, sacrificing user experience for
out of date browsers.

Luckily, we can use a short JavaScript command targetting IE to accomplish a nice fluid layout with max & min widths in IE6:

#page-wrap
{
min-width:800px;
max-width:1000px;
width:expression(document.body.clientWidth < 800? "800px" : document.body.clientWidth > 1000? "1000px" : "auto");
}


In the above example, you can see that the smallest width for this page is 800px, and the largest is 1000px; not much of a flex,
but the concept can be applied to any element.

And if you only wanted to use min-width:

#page-wrap
{
min-width:800px;
width:expression(document.body.clientWidth < 800? "800px": "auto" );
}

adn also can try this-one


.with_minheight {
  min-height:550px;
  height:auto !important;
  height:550px;
}

Monday, 4 July 2011

Import Script, Import CSS, Import PHP

JavaScript:

<script
   type='text/javascript'
   src='directory/file.js'>
</script>
CSS:
<style type='text/css'  media='all'>
   @import 'directory/file.css';
</style>

Icon:

<link
   rel='Shortcut Icon'
   href='directory/file.ico'
   type='image/x-icon'>

PHP:

<?php @ require_once ('directory/file.html'); ?>

For the PHP import, by placing the @ symbol before require_once suppresses any error messages that might be generated in the included PHP file.

JSP:

<%@ include file='jspfile.jspi' %>

And, well, I guess the list can go on and on. You can use Struts Tiles to include other JSP snippets. I am sure that other languages and frameworks have the same functionality.

Monday, 20 June 2011

Detect browser with javascript

I am using this code to change padding in 'li' of menu of the page. You can change code easily to to do tasks according to detected browser.

Just copy and embed this code in script tag of html of your page.

//A. Target Safari

if( $.browser.safari ) $("#menu li a").css("padding", "1em 1.2em" );

//B. Target anything above IE6

if ($.browser.msie && $.browser.version > 6 ) $("#menu li a").css("padding", "1em 1.8em" );

Thursday, 16 June 2011

create Shapes with css3


Css shown below is editable

Square

Rectangle

Circle

Friday, 10 June 2011

jQuery animate() function (Css)


jQuery animate() function is very powerful API to manipulate html elements and add animation functionality. The use of animate function is very simple. First lets check the syntax of this function.


.animate( properties, [ duration ], [ easing ], [ callback ] )
  • properties: A map of CSS properties that the animation will move toward.
  • duration: A string or number determining how long the animation will run.
  • easing: A string indicating which easing function to use for the transition.
  • callback: A function to call once the animation is complete.
.animate( properties, options )