Skip to content
Alessandro Lacava
  • Home
  • Blog
  • Articles
  • Talks

Category 2 posts

CSS

Writing about CSS.

CSS16 Feb 2007

How to display an element in the center of the browser

Sometimes you might need to display an element, for example a div, in the center of the browser. Here is an example of how you can do it using JavaScript and CSS. This code assumes you have…

Read article ↗
CSS24 Nov 2006

How to add scrollbars to a block (e.g. a <div> element)

If you need to customize a list box, the HTML element might not be enough. In that case, you might want something that simulates the behaviour of . Here is the code for a custom list box:…

Read article ↗
Alessandro Lacava

Software, words, and the ideas in between.

GitHub ↗LinkedIn ↗X / Twitter ↗Email ↗
© 2026 Alessandro Lacava
RSS feedPrivacy and cookies