CSS VS HTML - Post ID 109007

User 562592 Photo


Registered User
2,038 posts

I have been using CSS for some time now, and I have always assumed that its most proper to use CSS for placing and positioning images on a page. However, I am beginning to see more and more people using html instead. I thought this was the old method, so I am not sure why I am beginning to see so much placement in html. This lead me to a question - non existential I promise - is there any advantage or disadvantage to use one method over the other in regards to page weight or loading time?
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 364143 Photo


Guest
5,410 posts

CSS for layout and HTML for content. Unless you are using a background image in CSS.
CoffeeCup... Yeah, they are the best!
User 562592 Photo


Registered User
2,038 posts

I think for me a distinction needs to be made between layout and positioning. I think an argument could be made regarding layout and images as part of that, whereas positioning is much more specific. I find it much easier to just place images in the html, but then you can both place and position images using CSS. I can't figure out which way is the standard operating procedure. I think I have read too many CSS books. Also, is there any difference in loading time doing one over the other?
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 364143 Photo


Guest
5,410 posts

Well you are always going to use HTML to add the image (content) and then use CSS to position the image (layout). What other way is there?
CoffeeCup... Yeah, they are the best!
User 562592 Photo


Registered User
2,038 posts

You use the div background property then position the image where you wish by placing the div in the html. Its quite flexible because it allows for not only both positioning and placement, but then you can do multiple layers through floating or bringing your content over the top of the image. If you don't want content over the top of the image then you set a class or a span and set a margin for the content to go above, below, or beside the image.

you will have to excuse me I am self taught and been doing this only a few years so I am not familiar with how people are generally taught to do these things. Most CSS freaks, as I consider myself, do everything with CSS. :D
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 364143 Photo


Guest
5,410 posts

What I am saying is that no matter what technique you choose from your examples above, you are still positioning the layout of the page using CSS. :) What method you choose can be debated by everyone as to what is better or not but as long as you are not using tables, you are golden. :D

My only note about background images in a div is the alternative content being displayed, or not.
CoffeeCup... Yeah, they are the best!
User 562592 Photo


Registered User
2,038 posts

Yea, I get it. :)

Do you know if there is a loading or page weight difference in one method over the other?
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 364143 Photo


Guest
5,410 posts

I don't think there is a great impact to worry about, either way.
CoffeeCup... Yeah, they are the best!
User 38401 Photo


Senior Advisor
10,951 posts

I don't know about you, but creating a CSS entry for every little image I want to place on my site is overkill to me. What I do is basically all the Layout is done in CSS, anything I add that is temporary or semi-temp (in other words I swap product images weekly, periodically change my dividers image and placements) I do with HTML divs, just easier to deal with it that way for me.
User 562592 Photo


Registered User
2,038 posts

Its not overkill if you want the same images to appear on a bunch of pages. Then if you need to change the image you alter one CSS file versus going through and changing the image on every one of your html pages.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com


Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.