Categories
CSS HTML HTML Templates

CSS: make divs auto adjust automatically to different heights on the container div

Basically you put a clear:both at the bottom of the floated elements, to pull the height of the container div down:

<html>
<head>
<style type=”text/css” media=”screen”>
#container {
background-color:#CCCC99;
width:50%;
}
</style>
</head>
<body>
<div id=”container”>
<div id=”left” style=”float:left;background-color:#CCCCCC; width: 40px;”>Too much content it goes off the background of the container div, how do I fix this? Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?</div>
<div id=”right” style=”float:right;background-color:#DDDDDD;”>THis is right floated div</div>
<div style=”clear:both”>This will make the size of container ok, no matter what is the content size of the floating divs</div>
</div>
</body>
</html>

<html>

<head>

<style type=”text/css” media=”screen”>

#container {

background-color:#CCCC99;

width:50%;

}

</style>

</head>

<body>

<div id=”container”>

<div id=”left” style=”float:left;background-color:#CCCCCC; width: 40px;”>Too much content it goes off the background of the container div, how do I fix this? Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?Too much content it goes off the background of the container div, how do I fix this?</div>

<div id=”right” style=”float:right;background-color:#DDDDDD;”>THis is right floated div</div>

<div style=”clear:both”>This will make the size of container ok, no matter what is the content size of the floating divs</div>

</div>

</body>

</html>

keyword: auto-height
Categories
CSS

CSS Sprites

How to generate them.

The easiest way is to use SpriteMe generator:

http://spriteme.org/

Add it to your browser as a bookmarklet, when you are in the website you want a sprite for click on the bookmark, and click on the “sprite images” button to autogenerate it.

You can also get the CSS for it on the same UI. Easy.

If you have to build it manually, best practices dictate:

1) Construct a matrix, with predefined square sizes of, for example 5×5, 10×10, 16×16, or whatever your images fit.

2) Drop your icons or images in the squares, since all the squares are the same sizes, you don’t have to calculate the CSS, you can just multiply the row and column number, and there your have your CSS setting

Categories
Contracting

Find out browser and operative system details from end user

supportdetails.com

Keyword: support

Keyword: browser compatibility

Categories
Contracting

Web Consulting – Initial website assestment with customer

Use this document to get a good field about what the customer is looking for when building his website.

Web Development — Website Initial Assessment

Categories
JavaScript

Javascript: Closures / object / function in javascript

Functions are first-class objects, i.e. they are objects and can be manipulated and passed around like just like any other object. Specifically, they are Function objects.

A closure is an expression (typically an inner function) that can have free variables together with an environment that binds those variables (that “closes” the expression).

Inner functions have access to the variables of their enclosing outer function, but after running the outer function, you can’t have access to modify their inner scope, just to use it.

Be careful with closures: they could occupy memory without the possibility of being clear out until next page reload.

Categories
mysql

MySQL example of how to do an insert on a table

INSERT INTO table_name (column1, column2, column3,…)
VALUES (value1, value2, value3,…)

Categories
mysql

MySQL example on how to add a timestamp column to a table

ALTER TABLE [table_name] ADD COLUMN [clumn_name] timestamp with time zone;

Categories
mysql

MySQL example of how to delete a record

DELETE FROM [table_name] where [condition_column]=’blahblah’;

Categories
mysql

MySQL example of granting permission to a user to a given table

GRANT DELETE ON [table_name] TO [user_name];

Categories
mysql

MySQL example of dropping a column

ALTER TABLE pub_agreements DROP COLUMN registration_id;