When posting a coding question, it’s important to help people to help you. Ideally, post a link to a web page that demonstrates the issue.
If that’s not possible (for example, if your site is not live yet) there are various other options. You might, for example, create a working example of the problem on a site like CodePen. You can then paste the link to your Pen here. (If you sign up for a free account at CodePen, your Pen will get embedded right here, like this:
http://codepen.io/oknoblich/pen/iadnh
Another option is to put together a working example of the issue and post the code here. For example, people often post something like this (remember to highlight your code and then click the button to format your code):
.wrapper {
width: 50%;
margin: 0 auto;
background: #e7e7e7;
}
.content {
width: 60%;
float: left;
}
The problem here is that those trying to help don’t know the full picture. What is the HTML that this applies to? To get the full picture, it would be useful to post all the code that is relevant to the issue.
So the ideal here would be to post the code for a full document that demonstrates the issue. E.g.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style media="all">
.wrapper {
width: 50%;
margin: 0 auto;
background: #e7e7e7;
}
.content {
width: 60%;
float: left;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="content">
<h1>Heading</h1>
<p>This is a paragraph. This is a paragraph.
This is a paragraph. This is a paragraph.
This is a paragraph. This is a paragraph.</p>
</div>
</div>
</body>
</html>
People can then copy this code, paste it into a new .html file and open it in their browsers to observe the problem. It’s then much easier to suggest a solution (which in this case might be to add overflow: hidden; to the .wrapper).
A Note on Posting Code
When posting a code sample, make sure to highlight your code and then click the button to format your code. For more detailed options on this, see the Adding Code Tags to your Post post below.
A Note on Browsers and Identifying your Problem
In your post, please indicate what browsers(s) you are seeing the problem in. Also identify which version(s) you tested in. For example, don’t say “My site is not working in IE”. There are five versions of IE currently in use, so we need to know which version you are seeing the problem in.
Also, please don’t just tell us your layout is “broken”. Be very specific about what looks broken to you. No one wants to scan your page from top to bottom to try to work out what you don’t like about it. (We often don’t have a picture of what you want it to look like—so feel free to post a screen shot of what you are aiming for.)
The posts below offer some posting tips and starting templates that you can use for posting code examples:
- Identify your Browser!
- Don’t just tell us that it’s broken: tell us HOW
- CSS Template
- JavaScript Template
- Using External Libraries
- Helping others Reproduce your Issue
- Adding Code Tags to your Post
- Don’t include PHP logic when asking for help with the HTML it generates
- Uploading images and other resources
- Including images in your code sample
- Preparing a Short, Self Contained, Correct Example (SSCCE)
- Starting a poll