Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Thursday, March 1, 2012

How to disable textarea resizing with Css?

Today I had to make `something` so my textarea field could not be resized. There might be different reasons why a user should not resize a textarea(which is a default setting in most browsers).
So if you want your textarea to be fixed, no rezise just use this in your css style:

    
.your_div textarea {
    resize: none;
}

There you go :)
Regards

Monday, February 20, 2012

How to verify if checkbox was checked in PHP after submit?

Often when you have a form in a html file(might be even php file as you might know) and submit to a php file you want to see if checkbox from your form was checked so you will save in your database accordingly some value.
I have a form like this:

<form name="AddUser" method="post" action="createUser.php">

<fieldset>
<legend>Add a user </legend>
<label for="name">Name</label>
<input type="text" name="name" id="name" value="" />
<br/>

<label for="newsletter">Subscribe to newsletter:</label>
<input type="checkbox" name="newsletter" id=" newsletter " value="" />
<br/>

<input type="submit" name="add_user_btn" value="Create" />
</fieldset>
</form>

As usually the solution is simple, using isset() method:
if(isset($_POST['newsletter']))
 $newsletter= 1;
else
 $newsletter= 0;

Thursday, January 19, 2012

Html web color codes and chart, how to get hexadecimal values

It happens very often when you need to get hexadecimal values for colors so you can set them as background color or color of a certain text in CSS style without opening Photoshop or other software. So I think that a useful link is this one http://html-color-codes.info/. I wrote this link because it was useful to me. It is not because of advertising reasons. :)

Thursday, December 29, 2011

How to write your first HTML page?

As this is going to be my first post on this blog I would like to start with HTML syntax. A html page is composed of tags. Tags are: html, head, body, p, h1, h2, div, span and others. Each one has a beginning and must have its end. So if you have a '<body>' tag then must have a '</body>' tag.
Here is a short example of an almost empty page in html.


<html>
   <head>
       <!--   hear will be head content: like css, javascripts, page title -->
   </head>
   <body>
       <!--   as tag is called: here you will put main content -->
       <h1> Your first header!!! </h1>
   </body>
</html>


Copy this code in a new text document. You could use Notepad. Save document as firstPage.html and open it with a browser(Firefox, Chrome, Internet Explorer).


Congratulations!!! You have just wrote your first page in html.