Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 12-04-2002, 07:51 AM   #1 (permalink)
Miststlkr
Registered User
 
Join Date: Jun 2002
Location: South of Sanity
Posts: 8
Miststlkr is on a distinguished road
CSS question

hey guys. dunno if anyone here is any good at CSS, but I thought I'd ask. I'm trying to learn and I am running into a problem.

I DL'd and printed the W3C specs for CSS2 and according to them if i put:

Code:
 P DIV{
    TEXT-INDENT: 5em;
  }
it should make the following code have indented paragraphs without the empty line between them.

Code:
  <P>This is LIne 1<BR>
  <DIV>This should be line 2, indented</P>
but for some reason it doesn't.

If i took out the P in the CSS code it will work, but i don't want every <div> to be an indent, just the ones in a <p>.

i am using IE 5.5, is it possible that it doesn't support decendant selectors??

thanks for any help.
Miststlkr is offline   Reply With Quote
Old 12-04-2002, 09:00 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,530
sde is on a distinguished road
i'm not sure what the "P" is for in your style code, but this should work:
Code:
<style>
DIV{
    TEXT-INDENT: 5em;
  }
</style>
sde is offline   Reply With Quote
Old 12-04-2002, 01:19 PM   #3 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
u'll be wanting

div.myCustomStyle {
blah: something;
}

or

p:first_child div {
blah: #px;
}

but please, don't put tags and words in html in uper case :'(

with first_child div will, obviously, have to be the first child of the "<p>" tags. should work
if not, check out: http://www.w3schools.com/css/
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 12-05-2002, 05:17 AM   #4 (permalink)
Miststlkr
Registered User
 
Join Date: Jun 2002
Location: South of Sanity
Posts: 8
Miststlkr is on a distinguished road
Thanks for the sugestions, but neither is what I was going for. I was trying to make any DIV inside the P indent 5 spaces, as if i had hit the tab button. I am trying to make paragraphed text without the blank lines between the paragraphs.

as for the kewords in caps.. i've been programming that way for over 5 years and in 4 or 5 different languages now.. not likely that'll change any time soon.... sorry.
Miststlkr is offline   Reply With Quote
Old 12-05-2002, 06:49 AM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,530
sde is on a distinguished road
that's weird.. it worked for me. i get an indent without 2 line breaks if i don't use the <br> tag. when you use the <div> tag, it always puts it on a new line. i took it from 5em to 1em because 5 seemed a little big. here's my code and i've attached a screen shot.
PHP Code:
<html>
<
head>
<
style>
DIV{
    
TEXT-INDENT1em;
  }
</
style>

<
body>

<
P>This is LIne 1
<DIV>This should be line 2indented</P>

</
body>
</
html
Attached Images
File Type: jpg test.jpg (23.1 KB, 21 views)
sde is offline   Reply With Quote
Old 12-05-2002, 07:01 AM   #6 (permalink)
Miststlkr
Registered User
 
Join Date: Jun 2002
Location: South of Sanity
Posts: 8
Miststlkr is on a distinguished road
thanks a lot.... i'll try again.... who knows.. maybe i missed a typo or something.....

the rteason i had done it as P DIV {....} was because according to the W3C specs (what I am using to learn from) that is supposed to mean that it will only be applied to DIV tags (all of them, not just the first) that are inside a P tag. but they also say that not all of the specs are being implemented by any browser yet so maybe IE just doesn't support that syntax... oh well..

thanks again for the help.
Miststlkr is offline   Reply With Quote
Old 12-05-2002, 07:55 AM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,530
sde is on a distinguished road
i've never payed much attention to w3c .. but if it looks good on ie, then it looks good on netscape, and then it looks good on ie and netscape on mac, then you are doing something right.
sde is offline   Reply With Quote
Old 12-05-2002, 08:29 AM   #8 (permalink)
Miststlkr
Registered User
 
Join Date: Jun 2002
Location: South of Sanity
Posts: 8
Miststlkr is on a distinguished road
LOL.. true. I only go by W3C because their "guide" was free.. as opposed to paying $60 for a book at Barnes and Noble to learn from only thing this cost me was the paper, ink and a 3 ring binder (it filled an entire 1" D-ring binder )

happen to know any other good tutorial sites for it? i tend to learn better by looking at examples....
Miststlkr is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DB Design Question Part II sde Program Design and Methods 10 09-02-2008 12:37 PM
CSS Explorer trouble (of course) easilyi HTML, XML, Javascript, AJAX 6 11-11-2004 04:59 PM
yet another CSS question. Admin HTML, XML, Javascript, AJAX 5 12-09-2002 01:04 PM


All times are GMT -8. The time now is 01:18 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting