0

Hi All,

Just wondering... I have a chunk of code which is reused on many pages. The boss has just told me he wants the displayed elements to look slightly different on some pages. I've designed the HTML to be layout independent but I'd like to know your opinions...

Is it best practise to carry on reusing the same code using CSS to mash things up a bit (inc hiding certain elements) or simply recreate the code excluding these elements?

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by jonadams51
0

Try creating an external css file and link it to the page, and if there are any edits to specific elements within your code, just pop it into the HEAD section

0

Try creating an external css file and link it to the page, and if there are any edits to specific elements within your code, just pop it into the HEAD section

Thanks Monstette

What I've got at the moment resembles this..


Home Page HTML...

<div id="homePage">
	<div id="xsales">
		<div class="xsale">
			XSALE HTML
		</div>
	</div>
</div>

Product Page HTML...

<div id="productPage">
	<div id="xsales">
		<div class="xsale">
			XSALE HTML
		</div>
	</div>
</div>

and the CSS looks like this...

/* Standard xsale CSS */
#xsales {...}
#xsales div.xsale {...}

/* Homepage xsales */
#homePage #xsales {...}
#homePage #xsales div.xsale {...}

/* Productpage xsales */
#productPage #xsales {...}
#productPage #xsales div.xsale {...}

The thing I'm concerned about is using the same HTML for both pages as the pages will look very different and the CSS to change them around will be quite complex. I'm wondering whether its best to just restructure the HTML page instead.

Edited by jonadams51: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.