SUBBUINDESIGN Blog

HTML Interview Questions -03

How to create nest tables within tables in HTML? We can create nest table i.e. table inside a table. To create table we use following attributes: <table>……</table>: declare starting and ending of table. <tr>…</tr>:...

CSS Interview Questions and Answers -02

Three selectors: h1, .warning and #footer, what they do ? An element points at a HTML-tag somewhere on your page. In the example above we want to style the <h1>-tag. Note that using an...

CSS Interview Questions and Answers

What is CSS? 1. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. Every element type as well as every occurrence of a specific...

HTML Interview questions -02

 11.Which of these tags are all <table> tags?   12.In HTML, inline elements are normally displayed without starting a new line.    13.How can you make a numbered list?   14.How can you make...

HTML Interview Questions -01

1. What does HTML stand for? Hyper Text Markup Language  2.Who is making the Web standards? The World Wide Web Consortium 3.Choose the correct HTML tag for the largest heading <h1> 4.What is the...

How to Get Image Information using PHP?

/* * @param string $file Filepath * @param string $query Needed information (0 = width, 1 = height, 2 = mime-type) * @return string Fileinfo */ function getImageinfo($file, $query) { if (!realpath($file)) { $file...

How to Get Users IP Address using PHP code?

Accounts for proxies: if (!empty($_SERVER[‘HTTP_CLIENT_IP’])) { $ip=$_SERVER[‘HTTP_CLIENT_IP’]; } elseif (!empty($_SERVER[‘HTTP_X_FORWARDED_FOR’])) { $ip=$_SERVER[‘HTTP_X_FORWARDED_FOR’]; } else { $ip=$_SERVER[‘REMOTE_ADDR’]; }

Partial Page Refresh

Refresh certain elements of a page using jQuery after a set amount of time, can be used with any element with an ID. I amended the example given with the URL to only refresh...

Sliding Background Links

$(‘a’, ‘#nav’).hover(function() { if(!$(this).parent().hasClass(‘current’)) { $(this).stop().animate({ backgroundPosition: ‘(0 -75px)’ }); } }, function() { if(!$(this).parent().hasClass(‘current’)) { $(this).stop().animate({ backgroundPosition: ‘(0 -0)’ }); } }); Slides up and down the background image of a link when...

Styled Popup Menu using jQuery

This idea is from Veer.com and how they handle the dropdowns for things like T-Shirt sizes. Thank you to Dennis Sa. View Demo HTML We’ll wrap a regular text input inside an <div>, which also...

Update Values of Entire Table using PHP

This code assumes you are connected to a MySQL database which has a table with Names and Emails. The idea is that it will output a table of every single value from that table,...

Truncate String by Words using PHP ?

Technique #1 <?php function trunc($phrase, $max_words) { $phrase_array = explode(‘ ‘,$phrase); if(count($phrase_array) > $max_words && $max_words > 0) $phrase = implode(‘ ‘,array_slice($phrase_array, 0, $max_words)).’…’; return $phrase; } ?> Technique #2 function limit_words($words, $limit, $append...

How to Insert a Div Tag?How to Insert a Div Tag

Hypertext Markup Language employs a number of elements used for creating different sections in a Web page to form a layout; one of them is a div tag (<div>). Div tags are used to...

How to Center a Web Page Without CSS?

Hypertext Markup Language (HTML) was created to give content providers a way to display information on the World Wide Web in a organized and structured manner. HTML’s limited ability to format and style information...

What is the Differences Between CSS & CSS3 ?

Cascading Style Sheets, known as “CSS,” is a Web design language that is used to control the look and feel of Web pages. CSS files are created separate from the Web pages during the...

The Infinite Grid

Grid systems are a key component of graphic design, but they’ve always been designed for canvases with fixed dimensions. Until now. Today we’re designing for a medium that has no fixed dimensions, a medium...

Growing Your Design Business

So you’ve launched your own creative business, and you’re starting to grow. That’s great! But good growth won’t just happen. Just like a junior designer starts with small projects and slowly builds her skills, a...

How to use .htaccess?

‘.htaccess’ is the filename in full, it is not a file extension. For instance, you would not create a file called, ‘file.htaccess’, it is simply called, ‘.htaccess’. This file will take effect when placed...

What is .htaccess?

The .htaccess is a configuration file for use on web servers running the Apache Web Server software. When a .htaccess file is placed in a directory which is in turn ‘loaded via the Apache...

Highlight Related Label when Input in Focus

  $(“form :input”).focus(function() { $(“label[for='” + this.id + “‘]”).addClass(“labelfocus”); }).blur(function() { $(“label”).removeClass(“labelfocus”); });

jQuery Sticky Footer

In general the CSS Sticky Footer is the best way to go, as it works perfectly smoothly and doesn’t require JavaScript. If the markup required simply isn’t possible, this jQuery JavaScript might be an option. HTML...

Server Side Image Resizer

The code uses PHP to resize an image (currently only jpeg). Using this method, the resized image is of much better quality than a browser-side resizing. The file size of the new downsized image...

PHP Array Contains

Check if value is in array and outputs Yes or No <?php $names = array( ‘Bob’, ‘Jim’, ‘Mark’ ); echo ‘In Array? ‘; if (in_array(‘foo’, $names)) echo ‘Yes’; else echo ‘No’; ?>

PHP Date Parameters

formatcharacter Description Example returned values Day — — d Day of the month, 2 digits with leading zeros 01 to 31 D A textual representation of a day, three letters Mon through Sun j Day of the month...

How to put Exactly Center an Image/Div Horizontally and Vertically?

.center { width: 300px; height: 300px; position: absolute; left: 50%; top: 50%; margin-left: -150px; margin-top: -150px; } Negative margins are exactly half the height and width, which pull the element back into perfect center....

Expanding Boxes Navigation using CSS3

nav { background: #444; border-bottom: 8px solid #E6E2DF; overflow: hidden; position: relative; width: 100%; } nav:after { content: “”; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: white; } nav ul...

Is your plugin Naughty or Nice?

WordPress 2.1 is almost here and you know what that means for developers. It’s time to pull out those old plugins you’ve had stashed, blow off the dust and start applying some spit and...

WordPress 3.6 Beta 2 is now available!

This is software still in development and we really don’t recommend that you run it on a production site — set up a test site just to play with the new version. To test WordPress 3.6, try the WordPress...