javascript - Responsive Website (Link Rel / Media Queries / Load Css and Html) -


nice meet all! i´m mauro cordeiro brazil, , i´m starting learn coding, , following lots of tutorials. love stack overflow! learn lot guys!

in fact i´m musician , character animator, , i´m working , finishing band´s official website! it´s called leatherjacks, i´m loving code too! =)

my doubt media queries , loading contents.

i´m building responsive website , have "link rel" code @ start of desktop html code, shown below:

<!--the main website --> <link rel="stylesheet" type="text/css" href="m:\00_leatherjacks - 2017\06_website\01 - leatherjacks - website 2017\01_css\01_responsive_1920px.css">     <!-- meta tags different resolutions -->  <link rel="stylesheet" media="(max-width: 1368px)" href="m:\00_leatherjacks - 2017\06_website\01 - leatherjacks - website 2017\01_css\02_responsive_1368px.css">  <link rel="stylesheet" media="(max-width: 1000px)" href="m:\00_leatherjacks - 2017\06_website\01 - leatherjacks - website 2017\01_css\03_responsive_1000px.css">  <link rel="stylesheet" media="(max-width: 816px)" href="m:\00_leatherjacks - 2017\06_website\01 - leatherjacks - website 2017\01_css\04_responsive_mobile.css"> 

but in fact, when redimension browser 816px, loads css style, not html file (i mean: html coding did mobile resolution, contains less div´s , stuff).

how load both html , css @ main html code, guys? what´s best way it?

i tried jquery if / else conditional, using "location", didn´t work.

what need page works , chande (both css , html) when reduced 816px width or less.

the resolutions (1920px, 1368px , 1000px) works , fits gloves haha! working percent values it´s bless hahaah!

anyway, thank much, guys!

any precious me finish , publish page!

let´s rock!

mauro.

try like,

ex:-

<link rel="stylesheet" media='screen , (min-width: 816px) , (max-width: 1000px)' href="04_responsive_mobile.css"/> <link rel="stylesheet" media='screen , (min-width: 1001px) , (max-width: 1368x)' href="03_responsive_1000px.css"/> 

you have of media queries in 1 file well.

ex:-

enter image description here

also highly suggest have folder structure without spaces.

the space character unsafe because significant spaces may disappear , insignificant spaces may introduced when urls transcribed or typeset or subjected treatment of word-processing programs

and suggest should use relative paths.

relative paths

  • is image in same directory file referencing it?
  • is image in directory below?
  • is image in directory above?

by "below" , "above", mean subdirectories , parent directories. relative file paths give way travel in both directions. take @ primitive example: enter image description here

here need know relative file paths:

  • starting "/" returns root directory , starts there
  • starting "../" moves 1 directory backwards , starts there
  • starting "../../" moves 2 directories backwards , starts there (and on...)
  • to move forward, start first subdirectory , keep moving forward

including html within html

w3 js

html

<div w3-include-html="content.html"></div> 

js

<script> w3.includehtml(); </script> 

jquery

html

<div id="includedcontent"></div> 

js

<script>  $(function(){   $("#includedcontent").load("content.html");  }); </script>  

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -