html - php include statement -
I am working using my first website php. I came in a good way, or I thought, where am I to deal with the incorporation of CSS sheets. For example, I have a form I present with this code:
$ root = '../'; Death of the function ($ error) {Include '../includes/header.php'; Echo "We are very sorry, but error (s) has been found in your submitted form."; Echo "these errors appear below.
" Aloe $ error
Echo "Please go back and fix these errors.
Include '../includes/footer.php'; Die (); }
I have set the variable $ root for "$ .." and then here is the relevant part of header.php:
I would think that it will put "../" in front of styles, but it does not do anything why does not it work?
Thank you! You can create paths to complete your CSS file:
& lt; Link href = "/ styles / styles.css" rel = "stylesheet" type = "text / css" />Prefix URLs with a forward slash (
/ <>>) will make the URL relative to the root of your site. The above example would be some context like
http://example.com/styles/styles.css
. In this way, you can put all your CSS into a folder in the root of your site and can not worry about the path at all.
Comments
Post a Comment