Jump to content

What instead of tables?


collbrankid

Recommended Posts

I am creating a staff information page on my website that I have created using CSS.

 

I want small profile pictures by each profile paragragh for all of the officers in my club:

 

http://people.brandeis.edu/~nwkaplan/staff.html

 

So, I want the pictures to align perfectly with the profile paragraphs, and I thought a table might do the job...

 

Can I do this without using a table? Is there some CSS trick to align the pictures with the paragraphs?

 

Thanks in advance,

Noah

 

Link to comment
Share on other sites

I am creating a staff information page on my website that I have created using CSS.

 

I want small profile pictures by each profile paragragh for all of the officers in my club:

 

http://people.brandeis.edu/~nwkaplan/staff.html

 

So, I want the pictures to align perfectly with the profile paragraphs, and I thought a table might do the job...

 

Can I do this without using a table? Is there some CSS trick to align the pictures with the paragraphs?

 

Thanks in advance,

Noah

 

 

Dont use tables, its easy. Just make the images float to the left.

 

Examble:

<img src="ProfilePicture.png" alt="Profile Picture" name="Profile Picture" style="Float: left;">

 

 

I havent had a in-depth look at your code, but you might need to display your paragraphs as a block, and give them a fixed width.

 

Examble:

<p style="display:block;width:250px;"></p>

 

Ofcause it will make things easier to keep the things in a stylesheet, but this is just some off-hand code.

Link to comment
Share on other sites

Don't do that and don't use inline styles either.

 

HTML

 

<div class="item_staff">
   <img class="photo_staff" src="the/link/to/photo.jpg" alt="Photo Description">
   <p><strong>Name and position of staff memeber.</strong> Staff paragraph about.</p>
</div>

 

Stylesheet

 

.item_staff {
position:relative;
padding-left: 120px;
}

/*either*/
.photo_staff {
position:absolute;
top:0;
left:20px;
}

/*or*/
.photo_staff {
float:left;
margin-left:-100px;
}

 

I prefer absolute position because of some problems that IE6 can throw up with negative margins.

Link to comment
Share on other sites

Whoa! Um, you should actually create an html document before attempting to debug any css layout elements.

 

This, is no way to go about in web life, son:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<link type="text/css" rel="stylesheet" href="parastyle1.css">
  <title>Brandeis University : Business Club</title>

<style type="text/css">
body {background-color: #213AB5;}
</style>

<div class="container2">
<div class="container">

 

PROPER HTML document structure. DOCTYPE, html tag, head tag, title tag, meta tags, link to css, close head tag, body tag, web content HERE, close body tag, close html tag.

 

Without a proper structure, your page is something that every browser will have to assume as html (and display as it can best guess).

 

Here is what that page needs (at minimum):

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link type="text/css" rel="stylesheet" href="parastyle1.css">
<title>Brandeis University : Business Club</title>
<style type="text/css">
<!--
body {background-color: #213AB5;}
-->
</style>
</head>

<body>
<div class="container2">
<div class="container">

etc. etc.
Blah, blah blah.

</body>
</html>

 

Once you fix your HTML structure, we can help work on your css.

 

Dave

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.