I sense from reading this forum that it's not cool to overuse divs. To avoid this should I enclose a full-width image in an alternate tag such as <p>? Nothing else will be in the block except the image.
It is indeed uncool to overuse DIV, but don't get the wrong idea and think they are evil. Unfortunately, some people got that wrong part of it, and started to abuse semantically meaningful elements instead, like P. Therefore, some of them don't use tables even when given data is tabular, and start nesting, not DIV, since they are evil, but P and SECTION (html5)! That's why many of them slap the 5-lip service, they just don't get it! There is no need to enclose it anywhere, if that's that IMG is the only child. Not that IMG belong to a paragraph anyway! If IMG can be considered as a group of sentences dealing with a particular common point, then you must have followed that "PSD to HTML tutorial" wrong! Even those dumb dipshits clearly state that text shouldn't be "sliced".
There likely is a block level element with the proper semantic value to hold the image. But you haven't provided enough info to say which. What is the meaning of the image? Is it the company/site/page's name in graphic form? If so, the likely container is a header, e.g. H(x). Otherwise, consider the image a text replacement (you do have an alt attribute and value, right?). Then another text holder is implied. The div element is an aggregating element, used to hold multiple block elements in a unified context. It has no semantic value, itself. In a similar manner, the span element is a non-semantic segregating element; intended to separate the tagged inline content from adjacent inline content. If you find yourself using either in a different manner, it's a good bet you're doing it wrongly. Step back and see if there isn't a semantic element tag that applies. If that answer is lacking for you, tell us more about what the image is doing — what it says and its context. cheers, gary
I would say nothing is really 'wrong' with the DIV, it would be far, far, far, far, FAR less wrong than putting it in a P since what the devil makes that IMG a paragraph of text? The only time a P around a IMG would be appropriate is when that IMG is in flow -- like say a smilie DIV is a semantically neutral container, it does not change the meaning of what it's wrapped around (the same goes for it's inline-level counterpart, SPAN) -- it should be used AROUND tags with meaning to group them together as needed or to apply style. Not sure what the devil "projects the main theme of the site" even means, unless as kk5st suggests it should be the H1; heading under which all other content on the page is a subsection and all other headings on the page indicate the start of a subsection... in which case it shouldn't even BE an IMG tag, it should be applied from the CSS as that's presentation, NOT content. IMG is for content images, not 'presentation' or theme images! Of course if the image IS content and should be in the markup as IMG, and assuming you already have some form of outer div for applying something like width restrictions or to group together a section of content for styling -- what the devil does it even need a block level container around it for in the first place? THAT's the question a lot of people fail to ask, and it's the most important one when it comes to using DIV. You see it all the time around headings, images, and lists.... Menu lists in particular you'll see this garbage all the time: <div id="mainMenu"><ul> What the devil is being done to the DIV that couldn't be done to the UL, which is a perfectly good block-level container in it's own right? THAT's Divitus! If you aren't using that extra element to actually do anything you can't apply to the tag inside it directly, GET RID OF IT! There's no reason for a DIV -- much less a tag with semantic meaning like P or H1.