Showing posts with label css. Show all posts
Showing posts with label css. Show all posts

Simple Input Box Style

Whenever I browse the web I usually keep my eyes open for interesting styles or style components. Today I found a very nice looking input box; here. Here is my reproduction:

Please type here :
Here is the style for the above text box:
.simple
{
              border-width: 0 0 1px;
              border-style:none none solid;
              background:transparent;
              border-color:black; 
}
Anyway, I like the look of this simple input box and will be using it more.

Easily Center an Image in a Div

Who would have thought that this would be such a headache? After lots of reading on the web about how some browsers don't support this property and other browsers doesn't support that property I came up with a very simple solution that works perfectly for me in  IE8, Firefox and Chrome. The solution is to create a table with one tr and one td inside the div. Then make the table the same size as the div by setting the width and height of the table to 100%. Then simply set the text-align:center style on the td.

<div>
  <table width="100%" height="100%">
  <tr><td style="text-align:center"><img src="apple.jpg"></img></td></tr>
  </table>
</div>

Enjoy. Let me know if there is any issues with this solution.

Johan's Dev Blog Template

The template system at blogger.com (where this blog is being hosted) is quite nice and it allowed me to modify the look and feel of my blog within a couple of minutes to be close to what I wanted. I have uploaded the template that I am using here (look for devblog.css) if anybody is interested.