I messed up something on a multilingual site in the css (?) files so that the header of repucom.net/de , repucom.net/fr and repucom.net/pt is no longer on the top. On the english and japanese sites, repucom.net and repucom.jp, it stays on top.
I have no clue how I messed this up and would gratefully appreciate any help whereabout I should start digging into.
Fiddle for the working site (not sure if I did this right, if I should change anything - please let me know): http://jsfiddle.net/bn85y/1/
Fiddle for the non-working site: http://jsfiddle.net/zBbw5/
Html Example non working site:
<head profile="http://gmpg.org/xfn/11">
<title>REPUCOM</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="http://repucom.net/de/wp-content/themes/repucom-de/style.css" />
<div id="header">
<div id="branding">
</div><!-- #branding -->
</div><!-- #header-->
You need to save your file encoded as as UTF-8 without BOM, and that's gonna solve the issue. You'll probably find that option in your text editor.
For example if you're a Sublime Text user you'll find the option going to File>Save with Encoding>UTF-8.
You can always detect this kind of things running the W3C validator:
http://validator.w3.org/check?uri=repucom.net%2Ffr
Please, check that right after the opening <body> tag there is an empty string. If you remove it, the header will position itself correctly.
Related
I am using Sublime text to write some HTML and CSS files. I've created my index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="UTF-8" />
<title>RainyDayBakes</title>
<!-- Styles -->
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1 style="text-align:center">RainyDayBakes</h1>
<nav style="text-align:center">
<a href=”C:\Users\sarah\Documents\Simmons\CS-321\page1.html”> About </a>
<a href=”page2.html”> Menu </a>
<a href=”page3.html”> Gallery </a>
<a href=”page4.html”> Order </a>
<a href=”page5.html”> Contact Us </a>
</nav>
<img src="cake.png" alt="oreo crumble cake" class="center">
<h3>Welcome to RainyDayBakes!</h3>
<p>We are a local bakery specializing in creative cakes, cupcakes and cookies!</p>
<p>In addition to being open daily we also offer custom ordered confections.</p>
<!-- Scripts -->
<script src="scripts/index.js"></script>
</body>
<footer>
</footer>
</html>
my page1.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>This is Page One </title>
</head>
<body>
</body>
<footer>
</footer>
</html>
and my style.css:
<style>
h1 {
color:red;
}
</style>
When I try to run index.html in Chrome, the link to page1.html says it doesn't exist, and the CSS won't show up. They're all in the same folder, I've saved all the files, and I'm running on Chrome. Every other solution I've found refers to making a typo, the directories being different, etc. but as said, they're all in the same folder, and I haven't noticed a typo (but it's entirely possible when you're too close to your code).
First off, you're not even using the tag anywhere in your code, so that's why the style isn't showing up. Secondly, if they are in the same folder, just link your about page to page1.html; not the full directory listings.
You are using typographical quotes in your links' href attributes, which won't work. Change those to regular quotes.
Let the link be this way instead href=”page1.html”
You might want to put a link to your CSS file on all your pages, I don't see it on your page1.html You probably already know about this resource but I mention it just in case you don't: W3 Schools is very handy for a quick reference to a lot of HTML/CSS questions.
So you have two issues:
For page1.html, would suggest adding file:// or file:/// to the beginning of the href element, or maybe retyping the line since the other links worked
For your CSS, remove the tag, it's for when you put the style inside the HTML file(embedded)
This isn't an issue with your code. I was having the same exact problem too and i recently discovered that the problem likely lies in the IDE that you're using. I was using stackblitz and recived the same output. But when i switched to an online compiler and litteraly copy & pasted the code with the same file names, the code started working correctly. Try using an online compiler and see how that works out for you. It worked for me.
The compiler I used is:
https://www.onlinegdb.com/
make sure to switch the languate to HTML using the language dropdown on the top right corner.
I know the question has been asked a million times, but I just can't find any explanation to the following issue: I've inserted an image in my code, and when I open the page in my browser, I'm just having a broken link.
Here is my code:
<!doctype html>
<html>
<head>
<title>Laura Caroline’s Portfolio</title>
<link href=“/teststyle.css” type=“text/css” rel=“stylesheet”/>
</head>
<body>
<h1>About me</h1>
<p><img src=“portrait.jpeg”/></p>
</body>
</html>
The photo is in the same folder than the page. I've double checked the name.
I'm on MacOS Sierra (if of any help). Oh, and I'm a beginner :) Any clue about where to look to fix this?
Thanks!
As I can see make sure it's in the same directory. Try adding './file.jpg'
About the quotation marks they don't really look like the standard ones. So try replacing that with ""
I have a strange situation with my website where whenever it appears on Google Search, the alt text of one of the images is also displayed despite not being part of the <title> tag.
On my website (sparen.github.io), I have the following header:
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<title>Andrew Fan's Code Dump: The Embodiment of Code and Hacks (AFCDTECH)</title>
<link rel="stylesheet" type="text/css" href="blah.css">
<meta content="Andrew Fan's Code Dump: The Embodiment of Code and Hacks (AFCDTECH)"
name="description">
<meta name="keywords" content="Sparen, Touhou, Danmakufu, ph3, Tutorial, Script, Project">
<meta name="viewport" content="initial-scale=1">
<script>
<!-- Removed Google Analytics stuff for purposes of StackOverflow Question-->
</script>
</head>
<body id="mhome">
<div class="yui-t1" id="top">
<center><img alt=""Site Logo"" src="images/logo.png" style="width:90%"></center>
However, in Google Search, the title appears as follows:
***This is actually a different page, but all pages on my website seem to have the same issue, and all have the same header structure.
I don't know why it has that extra 'Site Logo' thing, which only appears as part of the image alt text in my banner (which is not even in the head but rather the body of the page).
It hasn't disappeared in the past few months, and it'd be nice to know if there's something I never took into consideration when originally building my website or if there's something BlueGriffon did before I migrated away from it.
Google seems to be confused by your quotes inside the alt text. Just remove them or use
<img alt='"Site Logo"' src="images/logo.png" style="width:90%">
Am I wrong or this could be a flaw (vulnerability?) in Google Search?
I have Html (hello.html) like bellow
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Test</title>
</head>
<body>
<div>
¿Hola cómo está?
</div>
</body>
</html>
It shows out as "¿Hola cómo está?" when run in browser
Is there any solution to get correct out put without altering the
hello.html file?
I hope that, it is in Spanish language but i looking for any other solution like as change the encode type or font in browser or editor.
Edit: Just noticed the requirement. But some Spanish characters require Unicode and you have to declare that in your html file.
Put this in your head.
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
I don't see whats wrong, if you are refering to the font type in the html and the webpage is different is because of your editor, if you really want to change the font you will need to set the font tag around your text or even better define it in the CSS
Based on the clarification in the comment section to your question....
If you are using Google Chrome, and your computer is set to an English locale, load the page, then right click on the body, and select "Translate to English."
Sounds like an interview trick question, rather than a programming one.
No.
You cannot do this without altering the html file.
Place this <meta> tag in your Head Section
<meta charset="UTF-8">
I was hoping that someone may know how to resolve this HTML5 validation error. When I try to validate my page: http://blog.genesispetaluma.com using http://validator.w3.org, it gives me the following error code:
Error Line 90, Column 63: An body start tag seen but an element of the same type was already open.
<body class="home blog single-author two-column right-sidebar">
I interpreted this error to mean that I have two body tags in the code. However, I have searched everywhere and can only find one <body> (the one referenced by the error) and one </body>. Can anyone please tell me how to resolve this error?
I had a similar problem but with <head>, giving the following W3C markup error:
A head start tag seen but an element of the same type was already open
I had this code:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<head>
When it was supposed to be:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
I knew that was wrong but it's hard to spot sometimes, as you're just so used to the header code being correct 99% of the time. I obviously cut n pasted some code and that ended up in the wrong place.
This isn't specific to your question, I know, as your error relates to the <body> tag, but this is the kind of thing you're looking for. Maybe you have a <link> or <meta> tag in your body somewhere, that's meant to be in the <head>. Without seeing your code, it's hard to give you a perfect answer.
Possibly it's because:
<div id="wrapFix">
<div id="drawLogo1">
<div id="drawLogo2">
<img src="http://genesispetaluma.com/img/logoNew.png" alt="Genesis Fitness G stylelogo">
</div>
</div> <!-- end of drawLogo1 -->
Is between your closing head tag and opening body tag. I.e. lines 81-87
One of the widgets (the facebook like button I believe) you're using is inserting HTML into the page and part of that HTML is a body tag. Not sure if there's anything you can do about this, but I think that's what's throwing the error. Looks like this:
<body class="plugin transparent_widget ff4 win Locale_en_US">
</html>
</iframe>
I got this error:
A head start tag seen but an element of the same type was already open
I read this post and then i noticed my tag listed before the head like this.
<title>Home</title>
<head>
</head>
it should have been
<head>
<title>Home</title>
</head>
It happens in below said scenarios as per my knowledge -
When you mistakenly choose <head> thinking <header> tag.
When your <header>, <nav>, <section> or <footer> tag(s) are outside of <body> tag.
So, after creating your page, you can validate these changes here.
I got the same error message : check out if any body-inside <element> is displayed between the <head> and <body>, like said above.
My error was caused by a <div> tag, with absolute position, to display some page information during the development - simply a line on a false position in the code.
Hi in my case hgroup tag is the reason why I'm having validation error I, remove this tag from head tag and put it inside after body tag after this the document is now valid.
Just for the record, I had exactly the same problem and it seems that including some php files within the head element was strangely giving the problem, even if the view-source of Firefox was not printing such php code nor tags
<head>
<? include("./file.php"); ?>
<title><? echo $title ?></title>
</head>
solved using:
<? include("./file.php"); ?>
<!DOCTYPE html>
<html>
<head>
<title><? echo $title ?></title>
</head>
<body>
...
...
If Your problem With head and body both are show validate error just remove displaying text from head and keep it in body..
I have been faces the problem recently.
For Example You have text to display in header inside head just remove header from head and keep it in body ......Problem solved...Thanks
In my case it was the facebook tag
<div id="fb-root"></div>
which was inside the page's <head>.
Moved that to the <body> of the relevant page (not required globally) sorted it. So yes, the answer supplied above by Emil H was correct.
Also bear in mind, if you copy/paste your code from things like slack, etc. they will have 'special characters' for formatting (that are usually invisible) which may cause that issue.
Here is a video to demonstrate: https://drive.google.com/file/d/1OJS15zmSvzhVXVLcQGGhePZGNCxWHocN/view
This error can happen if you put into <head> tag that restricted to be there. For example:
<head>
<audio preload="auto" class="menu-beep" id="sound-01">
<source src="sound-01.mp3">
</audio>
</head>
In this case, the tag will be immediately opened in the browser memory. But later the browser will find the body tag that opens the page. This is how it turns out that there is a second body tag.
I had similar problem with <head> tag. I use https://validator.w3.org
Look at few examples how to solve this problem:
<script> should be inside <head>
css should be inside <head>