Here is an example:
<div style="SET IMAGE ATTRIBUTES HERE!">
<img src="http://somesite.com/someimg.jpg"><br />
<img src="http://someothersite.com/someotherimg.jpg"><br />
...
</div>
With my dynamic ASP.NET code generation setup, I prefer to steer clear of using predefined CSS classes. The attributes needed will be different for each web control and cannot be set globally in the <head>
or <body>
sections. For instance, I may have two web controls on a single page, each requiring unique CSS attributes for their child images.
If all else fails, I could attempt to create a custom CSS class generator for these controls - but that would be overly complex and messy. Each web control would need to generate its own CSS class, insert it into the head
or body
sections somehow, and ensure there are no conflicts with other controls using the same class name. It would be chaotic and cumbersome, which is why I'd much rather include all necessary information within the attribute tags of the individual controls to prevent any overlap.