| 
	
 | 
 Posted by John Hosking on 05/25/07 16:11 
jobs wrote: 
> sorry for the noob question. 
 
We're all noobs sometime. :-) 
 
>  
> I know I can position a div tag in hmtl as such.. 
 
You mean a div *element* (which is delimited in the code by tags). You  
also mean HTML. 
 
>  
>   <div id=ccc style="align:bottom;position:absolute;left:1px;width: 
> 200px;height:300px;border: ghostwhite thin ridge;float-right"> 
> hello 
> </div> 
 
Only some of the above is valid CSS; some is just made up. 
 
>  
> is there any way to do all of this in css? 
 
Well, that was dressed as CSS (even if it wasn't actually valid), so you  
seem to think you're asking for the CSS equivalent of CSS. 
 
>  
> I tried this with no luck. I know the css is taking some effect 
> because i set background-color in the body entry and it worked. 
>  
> <div id="ccc"> 
> hello 
> </div> 
>  
> css: 
>  
> #ccc 
> { 
>  position:absolute; 
>  left:200px; 
>  top:400px; 
>  width:200px; 
>  height:300px; 
>  border: ghostwhite thin ridge; 
>  color: red; 
>  background-color:blue; 
> } 
 
Ah, I think I'm starting to get what you're wanting. You know you can  
use inline styles (your "in hmtl as such"), and now you want to use  
embedded or external styles. 
 
Without a URL pointing to the page you're having "no luck" with, I can't  
tell you what's wrong. But get in the habit of validating your code,  
http://validator.w3.org/ for markup, http://jigsaw.w3.org/css-validator/  
for CSS. 
 
>  
> FYI, i doing all of this in asp.net 2.0. 
 
No guts, no glory, I guess. You'll need to check the finished results  
produced by any tool you use. 
 
>  
> Another question, when should I use DIV and when should I use SPAN? 
 
Less often than you think. For paragraphs, use <p></p>, for headings use  
<h1>, <h2>, etc., for lists of thins use list markup. A div is a generic  
block-level element that you can use when no other markup is  
appropriate. A span is an in-line element that you can use when no other  
markup is appropriate. Both of these elements (div especially) are often  
misused when a more semantically meaningful element should be used. See  
the specs at http://www.w3.org/TR/html401/struct/global.html#h-7.5.4 . 
 
>  
> Thank you for any help or information! 
 
You're welcome. Hope this helps. 
 
--  
John
 
  
Navigation:
[Reply to this message] 
 |