[css tips] targetting chrome only browser - css chrome hacks

6:15 AM

(0) Comments

hi all some times you face problems in css adjustment and many differents between browsers
you can use SSI to target only IE browser but if you want to target Chrome you will have a serious issue here because there is no street way to do that

you can use some css hacks like:

1-:


body:nth-of-type(1) div.divname{width:500px;}

2-

@media screen and (-webkit-min-device-pixel-ratio:0) {
  div.divname{width:500px;} 
} 

and also you can target it via javascript

<script type="text/javascript">
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if(is_chrome){
document.write('<link rel="stylesheet" href="css/chrome.css" type="text/css" />');
}
</script>

thanks all see you in next tip

eslam

, ,

[tip] optimize your website acceleration via gzip and htaccess

8:38 AM

(0) Comments

if  you dont care about ie4 users so use gzip compression now its a technique to compress all media html , js , css , images and the browser can decompress it before viewing that enhance the acceleration of your website
you can do it via htaccess

just add these few lines

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
<Files *.html>
SetOutputFilter DEFLATE
</Files>

eslam

sorry for absence

8:32 AM

(0) Comments


hi all
sorry for not being post all previous days and thanks a lot for all message i received , as most of you know i live in Egypt and we now on a serious activity in Egypt towards liberty and democracy  so hope us luck and peace

eslam