What is the best way to design a website?

What is the best way to style/design a website so that its parts could easily be ported into another website?

  • The XHTML mark-up would be quite easy to port. But how about the CSS? For instance, one block-element can have its specific properties/style but then it can also be inheriting some of its properties somewhere. If I were to make another site and need to use the same style for one of its block-elements, then I have to trace back the entire hierarchy (from great-grandparent to child). But then I cannot automatically just copy and paste the entire hierarchy for the new site cause then, other elements will get affected globally. Also, let's say that at the onset, we aren't sure which parts we are going to re-use for another site. Is there an efficient way of doing this?

  • Answer:

    I would just try and standardize your markup. Use semantic markup instead of coding stuff by appearance (i.e. not <div class="red-notification"> but <div class="warning notification urgent">). Use multiple classes to style different elements the same way (i.e. .notification can always have a specific font in CSS, whether it's a button or a div or a text input field or a paragraph).

Dario Mars Patible at Quora Visit the source

Was this solution helpful to you?

Other answers

You should look into the the new HTML5 sectioning elements, which were introduced in part to solve this problem. http://www.456bereastreet.com/archive/201103/html5_sectioning_elements_headings_and_document_outlines/ The reason these were introduced was to promote modularity and reusability of HTML code. This helps out quite a bit for responsive designs as well, because then the blocks become independent and can be positioned to your liking.

Kevin Suttle

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.