Digital Point Forums
Winn Law Group

Go Back   Digital Point Forums > Design & Development > HTML & Website Design
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Sep 14th 2006, 4:50 pm
tayiper's Avatar
tayiper tayiper is offline
Hand of A'dal
 
Join Date: Apr 2006
Location: Ljubljana, Slovenia, Europe
Posts: 417
tayiper is on a distinguished road
Any reason to rather use CSS and not HTML...

.... in a totally basic/fundamental case of, for instance, specifying the border around a graphic/image on a page?? I mean is it generally better to use CSS instead of HTML, or in such cases as border around a graphic it doesn't matter, and one should probably only look for a size of the code (i.e. which method needs more lines/chars), at least if one is a minimalist like I am, lol.


The "CSS-style example code:

Code:
<img style="border:0; width:88px; height:31px" src="http://example.com/some-image.gif" alt="some-image.gif">

The HTML style example code:

Code:
<img border="0" width= "88px" height="31px" src="http://example.com/some-image.gif" alt="some-image.gif">

I am also curious, is there any "unwritten rule" that says which particular tag to use in which order; in CSS-style's case, which one is first, which one second etc.: "style", "src", or "alt" (and maybe we can include title), and in HTML-style's case, the appropriate order of the main/non-optional "style" and "src" (and again, we can possibly include alt and title ones too), and a sort of a "inner order" of border, width, and height ones ??


tayiper
__________________
If you want to, please check out my main general personal http://tadejpersic.50webs.com/ website, which is a some sort of a navigational site that basically only describes and lists links to my other websites and blogs.

Last edited by tayiper; Sep 14th 2006 at 6:00 pm.
Reply With Quote
  #2  
Old Sep 14th 2006, 5:00 pm
jose17 jose17 is offline
Hand of A'dal
 
Join Date: Aug 2006
Posts: 265
jose17 is on a distinguished road
One of the most important reasons why it's better to use CSS instead of HTML when it comes to defining how your website looks (i.e. colo of background, font color, border of images, etc) is that you can do all the styles in a CSS file and then just link this sheet to many HTML pages. And how does this comes handY?

Well for instance once you finish your site and you decide to change the background color of your site, if you use HTML you would have to open all the HTML pages you made and change the background tag for each page which is time consuming and annoying. In the other hand if you would have used CSS and link it to all your sites, you would just go to the sheet and change the properity of the background color and automatically the background on all your pages would change.

Also CSS gives you more control of how your web page looks.

Jose
Reply With Quote
  #3  
Old Sep 14th 2006, 5:55 pm
tayiper's Avatar
tayiper tayiper is offline
Hand of A'dal
 
Join Date: Apr 2006
Location: Ljubljana, Slovenia, Europe
Posts: 417
tayiper is on a distinguished road
Exclamation

Quote:
Originally Posted by jose17 View Post
One of the most important reasons why it's better to use CSS instead of HTML when it comes to defining how your website looks (i.e. colo of background, font color, border of images, etc) is that you can do all the styles in a CSS file and then just link this sheet to many HTML pages. And how does this comes handY?

Well for instance once you finish your site and you decide to change the background color of your site, if you use HTML you would have to open all the HTML pages you made and change the background tag for each page which is time consuming and annoying. In the other hand if you would have used CSS and link it to all your sites, you would just go to the sheet and change the properity of the background color and automatically the background on all your pages would change.

Also CSS gives you more control of how your web page looks.

Jose
Yeah, I know the difference between CSS and HTML, I was rather interested in this particular example, where the CSS is inline one (not external), but it is true, I did ask a question in general way.


Anyway, I was told on some other forum that the "align", "border", "hspace", and "vspace" attributes of the image element were deprecated in HTML 4.01, and additionally, they are not supported in XHTML 1.0 Strict (however regarding DTD, I use the XHTML 1.0 Transitional)


tayiper
__________________
If you want to, please check out my main general personal http://tadejpersic.50webs.com/ website, which is a some sort of a navigational site that basically only describes and lists links to my other websites and blogs.

Last edited by tayiper; Sep 14th 2006 at 8:32 pm. Reason: a minor fix
Reply With Quote
  #4  
Old Sep 14th 2006, 5:56 pm
jose17 jose17 is offline
Hand of A'dal
 
Join Date: Aug 2006
Posts: 265
jose17 is on a distinguished road
oh sorry, i thought you meant why use CSS instead of HTML :P
Reply With Quote
  #5  
Old Sep 14th 2006, 7:19 pm
tayiper's Avatar
tayiper tayiper is offline
Hand of A'dal
 
Join Date: Apr 2006
Location: Ljubljana, Slovenia, Europe
Posts: 417
tayiper is on a distinguished road
Quote:
Originally Posted by jose17 View Post
oh sorry, i thought you meant why use CSS instead of HTML :P
Yes sorry, I indeed did ask in "that kind" od way, lol ...


tayiper
__________________
If you want to, please check out my main general personal http://tadejpersic.50webs.com/ website, which is a some sort of a navigational site that basically only describes and lists links to my other websites and blogs.
Reply With Quote
  #6  
Old Sep 14th 2006, 7:30 pm
jose17 jose17 is offline
Hand of A'dal
 
Join Date: Aug 2006
Posts: 265
jose17 is on a distinguished road
SO what you are asking If it matters whetehr certaing tags have to be written before others?
Reply With Quote
  #7  
Old Sep 16th 2006, 1:07 pm
ifyn's Avatar
ifyn ifyn is offline
Grunt
 
Join Date: Sep 2006
Posts: 47
ifyn is on a distinguished road
Quote:
Originally Posted by tayiper View Post
Anyway, I was told on some other forum that the "align", "border", "hspace", and "vspace" attributes of the image element were deprecated in HTML 4.01, and additionally, they are not supported in XHTML 1.0 Strict (however regarding DTD, I use the XHTML 1.0 Transitional)
You need to worry about html tags only if you use xhtml strict, it is indeed not allowed to use Attributes name, align, border, hspace, vspace for img tag

here is a complete list : liorean.web-graphics.com/xhtml/comparison.loose-strict.html
Reply With Quote
Reply

Bookmarks

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with blog CSS vs HTML Kat2 CSS 6 Aug 1st 2006 12:11 am
Need an HTML page converted to CSS. onemancreative Programming 9 Jun 27th 2006 12:25 am
SEO and html, css valid nikola8 Search Engine Optimization 2 Jun 9th 2006 3:41 am
[Looking for HTML / CSS coder] warlock_cro Programming 3 Mar 21st 2006 6:15 am
CSS as important as HTML? gordonfreeman CSS 3 Feb 21st 2006 9:41 pm


All times are GMT -8. The time now is 4:09 am.