In Dreamweaver, is there a way to apply an external style sheet to a file without having to ad a link to the actual file in question? I would like to edit custom templates that don't have their style sheets declared to promote reusability.
-
1This basically belongs to Stack Overflow so you should probably ask there but the answer would probably be no, it doesn't even make sense to edit a css file and apply it to a template without actually linking the two. What would connect them?– AlinCommented Mar 2, 2016 at 18:57
-
Add the link, then remove it when you're done.– ScottCommented Mar 2, 2016 at 19:40
1 Answer
You would need to apply the CSS if I'm understanding your question:
<div class="chunk">
<style type="text/css" scoped>
p
{
text-decoration: underline;
}
</style>
<p>lorem ipsum dolor sit amet</p>
</div>
If you define the CSS in the file it is best to do that in the head and you can reference:
- Declare CSS style outside the “HEAD” element of an “HTML” page?
- Does have to be in the of an HTML document?
You could even do inline styling but either this approach or the above are the worst when trying to implement a template.
I would like to edit custom templates that don't have their style sheets declared to promote reusability.
This is backwards and I dont understand this sentence. If you are wanting to promote reusability then you would declare a style sheet in the head like:
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Starter Template for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link href="../../dist/css/bootstrap.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="starter-template.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
The approach to a custom external style sheet is edit once and effect everything that references the file. Your question's approach would literally mean you would have to copy the CSS and paste it into another file if you wanted to re-use the CSS.