twitter bootstrap - CSS not working on Localhost -
i building site , had of css, html working wonderfully. wanted add in php functionality have created local development environment on mac apache. moved of site folders new sites folder can accessed localhost. when loading website , none of css styles loading. using twitter bootstrap locally. css links in html:
link rel="stylesheet" type="text/css" href="http://localhost/~tromph/yoointoosite/bootstrap.min.css"> link rel="stylesheet" type="text/css" href="http://localhost/~tromph/yoointoosite/main.css"> i've tried every other path can think of , nothing else seems work.
i changed folder structure , file path to:
<link rel="stylesheet" type="text/css" href="/bootstrap-3.3.2-dist/css/bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="/bootstrap-3.3.2-dist/css/main.css" /> this fixed problem of not having css render. images linked in css not showing. dev tools telling me getting error 403 (forbidden) on each of images. should change permission?
i spent time updating permissions. working now. help!
i recommend referencing css files relatively. if have following folder structure.
myproj - css - bootstrap - bootstrap.min.css - index.html (or php) then reference bootstrap file so
<link rel="stylesheet" type="text/css" href="css/bootstrap/bootstrap.min.css" /> guessing @ folder structure example assume need is
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="main.css" /> if css files not in project, instead served externally, need reference them wherever serving them. example if serving them port 8080, need reference them using address instead.
<link rel="stylesheet" type="text/css" href="http://localhost:8080/bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="http://localhost:8080/main.css" /> again, above only if serving them externally site attempting use them from. if inside of project working on, reference them relatively file attempting use them.
Comments
Post a Comment