• Small Discription For Image - 1.

  • Small Discription For Image - 2.

  • Small Discription For Image - 3.

  • Small Discription For Image - 4.

New Post

Rss

Showing posts with label CSS3. Show all posts
Showing posts with label CSS3. Show all posts
Friday, 27 February 2015
no image

Media Queries for Standard Devices

A media query consists of a media type and at least one expression that limits the style sheets' scope by using media features, such as width, height, and color. Media queries, added in CSS3, let the presentation of content be tailored to a specific range of output devices without having to change the content itself.

Syntax
Media  queries consist of a media type and can, as of the CSS3 specification, contain one or more expressions, expressed as media features, which resolve to either true or false.  The result of the query is true if the media type specified in the media query matches the type of device the document is being displayed on and all expressions in the media query are true.
<!-- CSS media query on a link element -->
<link rel="stylesheet" media="(max-width: 800px)" href="example.css" />

<!-- CSS media query within a stylesheet --> 
<style> 
@media (max-width: 600px) { .facet_sidebar { display: none; } }
</style>

/* Smartphones (portrait and landscape) ----------- */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { /* Styles */ } /* Smartphones (landscape) ----------- */ @media only screen and (min-width : 321px) { /* Styles */ } /* Smartphones (portrait) ----------- */ @media only screen and (max-width : 320px) { /* Styles */ } /* iPads (portrait and landscape) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { /* Styles */ } /* iPads (landscape) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* Styles */ } /* iPads (portrait) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { /* Styles */ } /* Desktops and laptops ----------- */ @media only screen and (min-width : 1224px) { /* Styles */ } /* Large screens ----------- */ @media only screen and (min-width : 1824px) { /* Styles */ } /* iPhone 4 ----------- */ @media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) { /* Styles */ }
Make Non-Password Inputs Use Bullets (or Bullet Alternatives)

Make Non-Password Inputs Use Bullets (or Bullet Alternatives)


This works on texty inputs (e.g. text, email, etc) but you cannot change actual password inputs. Use case = ???.
CSS:
input { -webkit-text-security: none; } 
input { -webkit-text-security: circle; } 
input { -webkit-text-security: square; }
input { -webkit-text-security: disc;  /* Default */ }
no image

Replacing HR tag element with images

We start with some nice clean code for all the "alternative" browsers:

hr { border : 0; height : 15px; background : url(hr.gif) 0 0 no-repeat; margin : 1em 0; }

This seems to work for all standards compliant modern browsers. I've tested it on Opera, Safari & Firefox. However, it does not work on Explorer. IE treats the element as inline and demands a border around it and a minimum height of 1px.

IE supports very basic generated content with the list-style-image setting when combined with display: list-item. This is what I've used to get around the limitations.

Add this into conditional comments (or hacks if you prefer) to shift the element out of the way and insert a bullet picture in the resulting space:

hr { display : list-item; list-style : url(hr.gif) inside; filter : alpha(opacity=0); width : 0; }


Prevent Long URL’s From Breaking Out of Container

Prevent Long URL’s From Breaking Out of Container


Allow long words to be able to break and wrap onto the next line:

p.test {
    word-wrap: break-word;
}

Syntaxword-wrap: normal|break-word|initial|inherit;

A more robust browser support, you'll need more
-ms-word-break: break-all;
/* Be VERY careful with this, breaks normal words wh_erever */ 
word-break: break-all; 
/* Non standard for webkit */ 
word-break: break-word; 
-webkit-hyphens: auto; 
-moz-hyphens: auto; 
hyphens: auto;



Copyright © 2012 Core CSS All Right Reserved