Solved

help with css positioning

Posted on 2011-03-12
1
182 Views
Last Modified: 2012-05-11
Can someone please help me with some simple css? I'm new to it.

Attached is an image that I'm trying to layout with css. Basically its a "View Map" link which is anchored to the "top" of the segment, then directly to the right an image of the map, then directly to the right of that, anchored to the top as well, is some info, all left justified. I'm trying to learn some css basics here, whats the best way to do this? This "piece" will actually be repeated vertically, but if I get the css for the individual segments, I can repeat them. Thanks css layout to acheive
0
Comment
Question by:nuvium
1 Comment
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 35117114
Here's one way to do it.  You could also do it with tables and it might be simpler.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Div Table</title>
<style type="text/css">
<!-- 
.section {
	position:relative;
	float:left;
	border: thin solid black;
	margin-bottom: 7px;
	}
.sleft {
	float:left;
	width:120px;
	}
.scent {
	float:left;
	width:220px;
	height:160px;
	background-color: #eeeeee;
	}
.sright {
	float:left;
	width:120px;
	}
.stext {
	padding-left:3px;
	}	
-->
</style>
</head>
<body>
<h1>Div Table</h1>

<div class="section">
<div class="sleft">View Map</div>
<div class="scent">The map</div>
<div class="sright">
<div class="stext">Title</div>
<div class="stext">Info 1</div>
<div class="stext">Info 2</div>
<div class="stext">Info 3</div>
</div>
<br clear="all" />
</div>
<br clear="all" />

<div class="section">
<div class="sleft">View Map</div>
<div class="scent">The map</div>
<div class="sright">
<div class="stext">Title</div>
<div class="stext">Info 1</div>
<div class="stext">Info 2</div>
<div class="stext">Info 3</div>
</div>
<br clear="all" />
</div>
<br clear="all" />

</body>
</html>

Open in new window

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Read about why website design really matters in today's demanding market.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now