HTML5 and CSS3 have just arrived (kinda), and with them a whole new battle for the ‘best markup’ trophy has begun. Truth to be told, all these technologies are mere tools waiting for a skilled developer to work on the right project. As developers we shouldn’t get into pointless discussions of which markup is the best. They all lead to nowhere. Rather, we must get a brand new ideology and modify our coding habits to keep the web accessible.
Are you tired of dealing with different screen sizes for your web pages? Well, this information is for you.
I will show you some CSS tricks to help you reorganize a webpage depending on your browser window width.
We will start with a simple HTML 5 skeleton that includes a contents and a navigation section:
1<!DOCTYPE html> 2<html lang="en"> 3<head> 4 <style> 5 /* we will add our style here on the next step */ 6 </style> 7</head> 8<body> 9 <div role="main"> 10 <h1>This is the contents</h1> 11 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Here it is. Start with a conventional item list like the following:
1<ul class="hmenu"> 2 <li><a href="">Option 1</a></li> 3 <li><a href="">Option 2</a></li> 4 <li><a href="">Option 3</a></li> 5 <li><a href="">Option 4</a></li> 6 <li><a href="">Option 5</a></li> 7</ul> Don’t forget to add the class parameter to the ul tag – that will help us do the magic. The previous list is rendered in a regular browser like the following: Now, add the following CSS to your file:
Attribute selectors allow you to select CSS elements based on their attributes or values.
For example, if you want to select an image named “great.gif” you can do it by using the following rule:
1img[src="great.gif"] { border: 3px solid #000; } There are four types of selectors.
By attribute. The following example will select all the images that contain the given attribute:
1img[title] { border: 3px solid #000; } 2img[width] { border: 3px solid #000; } 3img[alt] { border: 3px solid #000; } By value.
by FreeBSD.orgAn example master zone file for example.org(existing within /etc/namedb/master/example.org) is as follows:
$TTL 3600 ; 1 hour default TTL example.org. IN SOA ns1.example.org. admin.example.org. ( 2006051501 ; Serial 10800 ; Refresh 3600 ; Retry 604800 ; Expire 300 ; Negative Response TTL ) ; DNS Servers IN NS ns1.example.org. IN NS ns2.example.org. ; MX Records IN MX 10 mx.example.org. IN MX 20 mail.example.org. IN A 192.168.1.1 ; Machine Names localhost IN A 127.
To get your CentOS version type:
1cat /etc/redhat-release To update all your CentOS packages at once:
1yum update To install nslookup, dig and other network utilities:
1yum install bind-utils -y
Show User ~/Library in OS X Lion Launch Terminal from Spotlight or Launchpad > Utilities, and enter the following command to show the directory:
``
chflags nohidden ~/Library/ The users Library folder will immediately become visible. Reverting this back to the standard Lion setting is simple too:
Hide User ~/Library in OS X Lion (default setting) This returns to the default setting of hiding the user Library directory:
``
Creating a simple gradient using two colors is very simple:
1Rectangle rect = new Rectangle(0, 0, 100, 100); 2LinearGradientBrush lgb = new LinearGradientBrush(rect, Color.White, Color.Blue, 90); 3e.Graphics.FillRectangle(lgb, rect); This code will generate a gradient in the given rectangle that goes from white to blue in a vertical way (see last parameter in constructor). In this case, e, is any class that encapsulates the System.Drawing.Graphics class. Once the gradient is ready, well, you have to actually draw it by calling the FillRectangle function.
Believe me, it is easy. As with any class, before we can use any of the Classes, Events and Objects available to us in the .Net Framework we need to import the Namespaces we need. For this we need 3 namespaces. VB.Net users only required 2 because VB.Net assumes the System Namespace, whereas C# isn’t so kind:
System System.Drawing System.Drawing.Printing These 3 Namespaces contain everything we need for this class, so you will need to add the following lines to the top of your class file:
There is a simple way to know this. The following code takes white (#ffffff) divided it by two as our reference color. If the comparing color is lower than the reference color, then the given color is dark, otherwise it’s light color.
1 function isLightOrDark($hexcolor) { 2 return (hexdec($hexcolor) > 0xffffff/2) ? 'light color' : 'dark color'; 3 }