I'm trying to reference the css files of bootstrap inside my views. I'm using Codeigniter as my framework. CI has a folder for the views, but I haven't been able to reference the stylesheets. This is what I'm doing right now:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/bootstrap.css" rel="stylesheet"/>
<link href="css/bootstrap.min.css" rel="stylesheet"/>
<title>
Login
</title>
</head>
<body>
<div class="container">
And so on... But the style is just plain html.
I know there are plenty of questions in stackoverflow regarding this, like this one, but I haven't found a solution in them. Any help would be great.
Solved my problem.
It was a mix of not putting the correct DOCTYPE and also for some reason I had to use <?php base_url();?> for the urls... If someone could explain this to me it would be great to learn more.
Related
Is there a way that this here below ↓↓↓ can be inserted as a snippet?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
</body>
</html>
I tried using Preferences -> Key Bindings - User but quotation marks really matters.
You can create a new snippet via Tools -> New Snippet...
You can read more about creating and using snippets here.
FYI, the HTML5 doctype is probably more appropriate and much easier to remember, simply:
<!DOCTYPE html>
Just to spell it out, so you don't need to follow links:
After selecting Tools -> New Snippet..., modify its content to the following:
<snippet>
<content><![CDATA[
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>$0</title>
</head>
<body>
</body>
</html>
]]></content>
<tabTrigger>newpage</tabTrigger>
<scope>text.html</scope>
</snippet>
The $0 between the <title> tags indicates that your cursor will end up here after triggering the snippet. If you'd like to have multiple insertion points that you can Tab between them, use $1 as the first, $2 as the second, etc., using $0 as the final spot.
Save the snippet in your Packages/User directory (it should be the default when you hit save) as newpage.sublime-snippet. To test it, open a new file, set the syntax to HTML, type newpage, and hit Tab, and you should be all set.
i have one image which works fine if reloaded in browser or if you enter in browser and click enter it will load else it will show nothing i have checked locally as well and it is not working if kept in img tag but if that image is opened seperately inh browser and then page is opened it is showing..
this is the image url
http://iv1.lisimg.com/image/1440189/600full-chae--young-han.jpg
almost all img urls of listal.com is like that.
i have tried basic image loader
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body><img src="http://iv1.lisimg.com/image/2359052/600full-kim-rossi-stuart.jpg" />
</body>
is this geographically targeted??/ or something like this?
please suggest
For some reason when I use a partial for the content in my Rails app, my HTML document tree breaks and the head elements spill over the body element. I've boiled this down to a very simple example:
app/views/layouts/application.html.erb:
<!doctype html>
<html>
<head>
<%= render :partial => 'shared/head' %>
</head>
<body id="test-id">
<h1>Hello World</h1>
</body>
</html>
app/views/shared/head.html.erb:
<title>Test Title</title>
result
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<title>Test Title</title>
<h1>Hello World</h1>
</body>
</html>
Note that the id attribute on was lost and the element is not where it should be.
Has anybody seen anything like this or can provide tips for debugging?
I'm running:
OSX 10.8.3
ruby-1.9.3-p392
rails 3.2.11 / WEBrick
Spree 1.1.4 (although I've stripped out anything that Spree might affect)
Turns out I had Deface running in the background which was causing an error which was mangling my <head>.
If anybody is running Spree and sees weird issues with their templating, first look at the Rails logs for Deface errors and check your libxml version. If it's > 2.8.0 you may need to downgrade. More info here.
The following is valid 'HTML 4.01 Transitional' according to the W3 validator:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or/TR/html4/loose.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="revisit-after" content="30 days">
<meta name="DC.Title" content="Website title">
<title>Website title</title>
</head><body></body></html>
When transforming this code to HTML5, the meta-tag underwent some changes as documented here. Thus, the following should be valid HTML5:
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<meta name="revisit-after" content="30 days">
<meta name="DC.Title" content="Website title">
<title>Website title</title>
</head><body></body></html>
Except that it doesn't validate as apparently meta tags are supposed to be registered now.
Problem: The W3 documentation does not list restrictions on meta-tags as a new "feature" of HTML5, but they do not validate like they did previously in HTML 4.01 Transitional.
Update: While the official HTML4 documentation does indeed not restrict the field values of the name attribute, the HTML5 draft mentions the new restriction (unlike the "differences" guide). Some posters suggest to not use meta-tags at all based on SEO arguments, but there have been many public and internal uses of meta-tags for cache control, documentation and storage purposes. Should there not be a way to turn valid HTML4 code into valid HTML5 code without relying on millions of meta-parsers to rewrite themselves automagically?
Question: What should we do in practice?
In practice, just leave the meta tags as they are. Even if the validator complains, it doesn't make a single bit of difference to anyone using your website.
Is it possible to have a portable area feed into a ASP.Net MVC 3 razor section? I have a section in my for placing JS files, CSS, fiels, etc. I want to be able to target the head section from portable areas for any JS, CSS files the portable area needs. Is this possible?
Thanks
Tom
You can use master page concept just like _Layout.chtml to put portable sections. (It event works for header)
<!DOCTYPE html>
<html>
<head>
<title>#ViewBag.Title</title>
<link href="#Url.Content("~/Content/Site.css")" rel="stylesheet"
type="text/css" />
<script src="#Url.Content("~/Scripts/jquery-1.4.4.min.js")"
type="text/javascript"> </script>
#{
//access your portable section here.
}
</head>
<body>
#RenderBody()
</body>
</html>