CSS Snippets

WebToolsKing.com brings you a selection of CSS snippets.

We provide a wide range of colour scheme samples, css snippets and articles

CSS Gallery

This is a basic image gallery layout using pure CSS and HTML. It will be using the UL tag to create it.

View Demo - Click Here

CSS


<style type="text/css">
#wrapper{
	margin:0 auto 0 auto;
	width:400px;
}
ul{
	margin:0;
	padding:0;
}
p{
	margin:0;
}
ul li{
	float:left;
	display:block;
	width:100px;
	text-align:center;
	margin: 10px;
	list-style:none;
	border: 1px solid #000;
}
</style>

HTML




<div id="wrapper">
	<ul>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />

			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />
			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />

			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />
			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />

			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />
			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />

			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />
			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />

			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />
			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />

			<p>Caption Here</p>
		</li>
		<li>
			<img src="thumbnail.jpg" border="0" alt="Thumbnail" />
			<p>Caption Here</p>
		</li>
	</ul>
</div>

CSS Horizontal Menu

This is a basic horizontal menu using pure CSS and HTML. It has been styled already to give the full effect of what it does

View Demo - Click Here

CSS

#wrap {
	padding:15px;
	margin: 0px;
	background:#555;
	width: 600px;
}
#content {
	padding:20px;
	margin-left: 4px;
	background:#fff;
	width: 550px;
}
ul#menu {
	list-style-type:none;
	width:100%;
	position:relative;
	height:27px;
	font-family:"Trebuchet MS",Arial,sans-serif;
	font-size:13px;
	font-weight:bold;
	margin:0;
	padding:11px 0 0 0;
}
ul#menu li {
	display:block;
	float:left;
	margin:0 0 0 4px;
	height:27px;
}
ul#menu li.left {
	margin:0;
}
ul#menu li a {
	display:block;
	float:left;
	color:#fff;
	background:#333;
	line-height:27px;
	text-decoration:none;
	padding:0 17px 0 18px;
	height:27px;
}
	ul#menu li a.right {
	padding-right:19px;
}
ul#menu li a:hover {
	background:#99cc00;
}
ul#menu li a.current {
	color:#2E4560;
	background:#fff;
}
ul#menu li a.current:hover {
	color:#2E4560;
	background:#fff;
}

HTML


CSS Vertical Menu

This is a basic vertical menu using pure CSS and HTML. It has been styled already to give the full effect of what it does

View Demo - Click Here

CSS

#wrap {
	padding:15px;
	margin: 0px;
	background:#555;
	width: 600px;
}
#menu {
  width:150px;
  margin:0;
}

#menu a {
  width:120px;
  border-left:5px #fff solid;
  background-color:#333;
  padding-top:8px;
  padding-left:10px;
  height:25px;
  font-family:Arial;
  font-size:14px;
  font-weight:bold;
  color:#fff;
  display:block;
  clear:both;
  text-decoration:none;
}

#menu a:hover {
  border-left:5px #99cc00 solid;
  background-color:#99cc00;
  color:#FFFFFF;
  text-decoration:none;
}
#menu a.current {
  border-left:5px #99cc00 solid;
  background-color:#fff;
  color:#2E4560;
  text-decoration:none;
}
#content {
	padding:20px;
	margin-left: 4px;
	background:#fff;
	width: 400px;
    position: absolute;
    top: 23px;
    left: 154px;
}

HTML

Content Here