Responsive design: is it better to hide or reposition elements?

I have the following dilemma with two elements (menu elements) that I need to move in a responsive design (now these are just two variations, say, one for a width of more than 750 pixels and the other for a width of up to 750 pixels):

Should I have two separate html blocks, one for each option, and hide / show them depending on the size of the application?

Or do I need to have only one html block and css styles that play with positions? This last option is rather complicated with the design that I plan, so the real question may be: is it too bad to have two different html blocks? The page will have javascript and ajax interaction, although I'm not sure to what extent. Thank you in advance.

+3
source share
4 answers

A statement of whether it is “bad” is subjective as to what your goals are. From the point of view of accessibility, this is not ideal for the same markup to be displayed twice and just toggle the hide of one or the other, but without knowing more about the details of your design, it is difficult to say with certainty that this should or should not be made a special way. I would say that in general this should not be so difficult, because your layout should not be structured according to layout or design.

+1
source

Some rules of thumb that I try to keep in mind for flexible designs are:

  • CSS . , CSS, . : HTML , .
  • , . , .
  • CSS. , Googlebot "". -, , .

, , HTML.

+3

, , . , , , .., HTML :

http://en.wikipedia.org/wiki/Don%27t_repeat_yourself

, , HTML- , CSS.

btw CSS, , , () , 1024 . CSS, , . HTML , .

+1

, html-... , ... , , ... html...

+1
source

All Articles