Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 2706 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

Quick tableless CSS question

Thread title: Quick tableless CSS question
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
08-08-2006, 07:58 PM
#1
VividWire is offline VividWire
Status: Member
Join date: Apr 2006
Location:
Expertise:
Software:
 
Posts: 262
iTrader: 0 / 0%
 

VividWire is on a distinguished road

  Old  Quick tableless CSS question

I have started using tableless CSS and am getting on really well with it, didnt realise it would be so simple. However I am trying to centre some content, which I have done just fine but the problem I am having is trying to set the 'top' position so it is displayed further down the page.

This is the code I am using at the moment:

#indexcontainer {
margin: 0 auto;
width: 650px;
text-align: left;
}

Any help would be great

08-08-2006, 08:08 PM
#2
Shanks is offline Shanks
Status: Senior Member
Join date: Oct 2005
Location:
Expertise:
Software:
 
Posts: 891
iTrader: 1 / 100%
 

Shanks is on a distinguished road

  Old

If I understand your problem correctly, I believe you should just set a top margin to #indexcontainer. Like this:

#indexcontainer {
margin: 1px auto;
width: 650px;
text-align: left;
}

You can set the amount of px to whatever you want. You can also use em or % instead of px. I think you could also do it by adding position:relative; and top:insertanumberherepx; but I think the first way is simpler.

08-08-2006, 08:12 PM
#3
VividWire is offline VividWire
Status: Member
Join date: Apr 2006
Location:
Expertise:
Software:
 
Posts: 262
iTrader: 0 / 0%
 

VividWire is on a distinguished road

  Old

Ahh, simple really.

Thanks for that

08-08-2006, 08:21 PM
#4
Shanks is offline Shanks
Status: Senior Member
Join date: Oct 2005
Location:
Expertise:
Software:
 
Posts: 891
iTrader: 1 / 100%
 

Shanks is on a distinguished road

  Old

Yeah, stuff like that is really easy if you just take a better look at the CSS2 Box model. It's pretty simple.

08-08-2006, 08:47 PM
#5
VividWire is offline VividWire
Status: Member
Join date: Apr 2006
Location:
Expertise:
Software:
 
Posts: 262
iTrader: 0 / 0%
 

VividWire is on a distinguished road

  Old

Thanks for the link... *bookmarks*

One other quick question, i have just created a style with a border, is there any way I can get inner 'cell space' like you can with tables?

08-08-2006, 09:30 PM
#6
Shanks is offline Shanks
Status: Senior Member
Join date: Oct 2005
Location:
Expertise:
Software:
 
Posts: 891
iTrader: 1 / 100%
 

Shanks is on a distinguished road

  Old

Well, let's say you have a paragraph enclosed in a div with a border, like this:

HTML
Code:
<div>
<p>
</p>
</div>
CSS
Code:
div {
border: 1px solid #000;
}
You can either add padding to the div (parent element) or a margin (child element) to the paragraph. This article recommends adding a margin to the child element, which in this case is the paragraph.

Add this to your stylesheet:
Code:
p {
margin: 10px; 
}
I think this is what you mean by cell space. I assumed you were referring to the cellspacing attribute on the table element.

08-09-2006, 08:51 PM
#7
VividWire is offline VividWire
Status: Member
Join date: Apr 2006
Location:
Expertise:
Software:
 
Posts: 262
iTrader: 0 / 0%
 

VividWire is on a distinguished road

  Old

Still not quite sure how to do it, this is the code I am using:

#clientbar {
width: 638px;
text-align: left;
border: 1px solid #E3E3E3;
border-collapse: separate;
background-image: url(images/main/main-cbarbg.jpg);
height: 19px;
margin: 2px auto;
background-repeat: repeat-x;
background-position: center center;
}

In a way what i want is an extra 'inner' 1px border which is white, any way to do this?

08-10-2006, 07:24 AM
#8
duncanp is offline duncanp
duncanp's Avatar
Status: Junior Member
Join date: Aug 2006
Location: HH, UK
Expertise:
Software:
 
Posts: 39
iTrader: 0 / 0%
 

duncanp is on a distinguished road

  Old

noobish reply, but cant you just stick <center></center> in the html around it?

08-10-2006, 01:58 PM
#9
VividWire is offline VividWire
Status: Member
Join date: Apr 2006
Location:
Expertise:
Software:
 
Posts: 262
iTrader: 0 / 0%
 

VividWire is on a distinguished road

  Old

Thanks for the reply but that will not work, the background is set to repeat so I cannot set the background image at the correct size, and I also need this code for some other borders I am going to be using where there is a solid background and I will want whitespace between the border and the content.

08-15-2006, 09:38 PM
#10
VividWire is offline VividWire
Status: Member
Join date: Apr 2006
Location:
Expertise:
Software:
 
Posts: 262
iTrader: 0 / 0%
 

VividWire is on a distinguished road

  Old

any suggestions for the inner-border / padding??

Closed Thread  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed