|
-
Aug 3rd, 2012, 06:49 AM
#1
Thread Starter
Addicted Member
Javascript break with paragraph
Ok, the topic title don't tell much so let me explain. When I use break tag within javascript without paragraph its all perfect, the space betwen rows is good. But when I use paragraph inside javascript and then use break the spacing is way too big. Here is complete code:
Code:
<!-- Web page created by Mr.Joker -->
<html>
<head>
<style type="text/css">
#search_form {
-moz-border-radius:10px;
border-radius:10px;
-webkit-border-radius:10px;
margin-top:100px;
margin-left:auto;
margin-right:auto;
width:400px;
height:100px;
background-color:#f0f0f0;
border:1px solid #c9c9c9;
}
.search {
width:240px;
height:32px;
margin-left:25px;
margin-top:33px;;
background-color:#ffffff;
border:1px solid #cacaca;
color:#b9b9b9;
padding:3px;
}
.button {
width:100px;
height:30px;
background-color:#869abf;
border:1px solid #65758e;
color:#ffffff;
}
#main_div {
width:600px;
height:400px;
margin-left:auto;
margin-right:auto;
background-color:#f0f0f0;
border:1px solid #c9c9c9;
margin-top:30px;
}
p {
margin-left:10px;
margin-top:10px;
color:#a5a3a3;
}
</style>
<script type="text/javascript">
/*If you dare to copy this code without puting credits, I will find you and make you cry*/
function Get_help() {
var info = "/info";
var help = "/help";
var html = "/html";
var css = "/css";
var colors = "/colors";
var fonts = "/fonts";
var info_website = "This webpage is developed for helping every coder to get most common things he need for making web pages. This webpage is created by Mr.Joker for CSS Help forum members. It's not allowed to use this webpage for your forums. This page is only for members of CSS Help forum.";
var help_website = "To use this webpage you have to type slash (/) and then some word that is allready registred as default value. " + "<br />" + "<br />" + "List of default values: " + "<br />" + "1. /info" + "<br />" + "2. /help" + "<br />" + "3. /html" + "<br />" + "4. /css" + "<br />" + "5. /colors" + "<br />" + "6. /fonts" + "<br />";
var html_website = "This is HTML section. Here you also have default values to use:" + "<br />" + "<br /> " + "1. /html.info" + "<br />" + "2. /html.paragraph" + "<br />" + "3. /html.link" + "<br />" + "4. /html.images" + "<br />" + "5. /html.lists" + "<br />" + "6. /html.table" + "<br />" + "7. /html.forms";
var css_website = "This is CSS section. Here you also have default values to use: " + "<br />" + "1. /css.info" + "<br />" + "2. /css." + "<br />"
var colors_website = "";
var fonts_website = "This is Font section. Here you can see HTML fonts that you can use :" + "<br />" + "<br />" + "<p style='font-family:Arial;'>Arial</p>" + "<br />" + "<p style='font-family:Calligrapher;'>Calligrapher</p>";
var get_input = document.forms[0].search.value;
if (get_input == info) {
document.getElementById('paragraph').innerHTML = info_website;
} else if(get_input == help) {
document.getElementById('paragraph').innerHTML = help_website;
} else if(get_input == html) {
document.getElementById('paragraph').innerHTML = html_website;
} else if(get_input == css) {
document.getElementById('paragraph').innerHTML = css_website;
} else if(get_input == colors) {
document.getElementById('paragraph').innerHTML = colors_website;
} else if (get_input == fonts) {
document.getElementById('paragraph').innerHTML = fonts_website;
}
}
</script>
</head>
<body>
<div id="search_form">
<form>
<input type="text" name="search" value="Enter keyword to search..." class="search" onClick="document.forms[0].search.value = '';" /> <input type="button" class="button" value="Search" onClick="Get_help();">
</form>
</div>
<div id="main_div">
<p id="paragraph"> </p>
</div>
</body>
</html>
To see the problem, type inside textbox /fonts
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|