HTML - External Txt File In Div Not Showing Line Breaks
Hi
I have the following code loading an external .txt file into a DIV <?php $content = file_get_contents($_SERVER['DOCUMENT_ROOT']."/text_files/about_text.rtf"); echo htmlspecialchars($content); ?> It loads, but the line breaks are ignored, so it appears as one continous string of words. How do I make the html display the text file's line breaks? Thanks for your time and info Shaun Similar TutorialsForgive me for this rather elementary question...I'm a T-shirt printer and I've learned enough html to build my own website, but I have a lot more to learn about it...Anyway the problem I'm having is when I add an image and want the next paragrah, or headline to display below the image, I've been accomplishing it by adding line breaks until it appears below rather than off to one side. Sometimes I have to add as many as seven or eight <br />'s to achieve my purpose. Is there a better way to make something appear below an image? Okay, so here's what I'm trying to do- This is a short excerpt of my page, the part that is causing the problem: HTML Code: <font color=#333333><b>Category: <div id="category" align="left">Category</div></b></font> I want to DISPLAY the Html code on my site, so I'm using < and > to achive this. Its working perfectly. Now, in the code that is being displayed- is an actual HTML code, that I want to turn into html. Here's where the problem is. As you can see- the actual Html code is: HTML Code: <div id="category" align="left">Category</div> I made sure not to change the tags, so that the browser will accept it as html. Now- my problem is that when I publish this on my site, an ugly page break appears before & after the real html code. I want to be able to copy the code that appears, and just simply paste it onto another part of the site- BUT, because of the line break that occurs, the HTML isn't displayed properly. Normally, a simple line break like this one won't affect anything- but I'm using WORDPRESS for my pages, and wordpress recognizes every time a line break happens, it makes a <br> code. So even if you press the enter key in HTML, it automatically ends up being a <br> code and breaks the whole html code. How will I make it so that the line break DOESN"T happen? TL;DR: I want to display HTML code on my site, but I want to have an ACTUAL HTML CODE inside the html code to be displayed. When I do this, a line break happens before and after the ACTUAL HTML CODE. How do I get rid of this? What my page currently looks like: HTML Code: <font color=#333333><b>Category: <div id="category" align="left">Category</div></b></font> Please help, everything is greatly appreciated! I am trying to build a page using drupal CMS but I have a problem. Whenn add checkbox, text and submit button together, each of them gets in a different line. It looks like i use <br> although i don't. Adding content with a WYSIWYG editor seems to be working into the editor content area. But when I save it, it appears again in different lines,no matter in which place of the frontpage I add it. So I guess I guess the reason is the style.css file. But I can't find the exact line that damages my code. In pictures below you can see 1)the content correctly presented into WYSIWYG editor 2)The content in frontpage (awful) 3)The simple html i use 1) http://www.teicrete.gr/libsite/files...wyg_editor.JPG 2) http://www.teicrete.gr/libsite/files...page_error.JPG 3) http://www.teicrete.gr/libsite/files/3_simple_html.JPG Any help would be great... Thanks in advance! For some reason whenever I have an img tag it causes an automatic line break. I was wondering if anyone else has encountered this problem. Basically i'm trying to add an small icon to the left of an active link. So the code basically looks like this.. <img src="icon.jpg"><a href="link.html">text link</a> The end result is a icon on one line and the link rests below it instead of everything being on one line. This is the first time this has ever happened and i'm wondering if this is normal? I realize this may seem like a noob question but any help would be appreciated. Thanks. hi y'all. my site looks fine in firefox (as usual) but ie is doing something weird. behavior is identical in IE 6 and 7, incidentally. the problem is in the sidebar. see the underlined titles for each section? in IE, a mysterious line break appears above each. what's going on? Hey guys, this may seem as an easy solution but I've been pulling hair over it. How do I get rid of the blank line breaks that appear before and after unordered lists? I attached a picture to this thread of what I am exactly talking about. Thanks in advance! I'm a complete newbie I have been told to edit a script in html editor on line No. 235. I put the script into an editor and it fills the page as one big paragraph and not in a line format. Is this a common thing Can it be changed? Neil I have an html application consisted of a number of html files, js files and css files. Is it possible to have an external property file where I can keep the name of the server so as to use a variable for the urls? For example to have something there like nameOfTheUrl=andreana and in the html file to have something like http://nameOfTheUrl/content/index.html My server has java but it is not a servlet container so I can not use jsp. Hi there, I've got an example xml page that I'm trying to separate into tidier pices (eg separate files for stylesheets, xsl, xml etc). However I don't know how to separate the xml file? Normally in html it's just something like with stylesheets/javascript etc: <script>script here</script> turns into <script src="external.js"></script> But that doesn't work with xml it appears, so can anyone tell me how I can remove the bit in <xml> ... </xml> to an external file and get it loading from that external file...? Can an image map be stored externally, and read in, when an image is read in? For my current project, I will have 67 different image maps, but for my next project, that will increase to 125 different image maps. George ok so to start off if I ask any dumb questions my apologizes. I have just started writing HTML code. I have done quite a bit of C++ but its been years and html is much different. Well here is my question I have made a dynamic sidebar for my webpages so I can cut out all those blocky link buttons at the top of the page. So I created an external html file and wrote the code for the side bar, but I can't figure out how to get it into my webpage html files. I am sure its something minor but I can't seem to figure it out. I have been able to get it on the page by using iframe but I really don't like iframe. One of the really big things is I want it locked to the right side of the browser screen so if you scroll it stays there. Also it needs to float above everything else so it will open on top of the webpage and no disrupt the content. I am sorry if this is a simple thing but I have spent 2 days reading everything I can on it and can't get it to work. I have tried it as a PHP file with include command. I tried link didn't work also. I know I could just include all the code on the pages but I am trying to learn how to use template correctly so as to make my pages as clean and SE friendly as possible. Last thing if I need to post some of the code up here to help I can do that. Well thanks in advance, this will make my day if I get this dang side bar to work. Thanks J Hi guys, I have a div on my page, which essentially just places a layer/table over the entire page and displays a "LOADING..." message, then promptly disappears when everything hidden beneath it has finished loading. I want to use this same div in several other pages, so I thought the best way would be to place it in an external file, then simply call it when required. Can someone please tell me how I can do this, i.e. what code I need to place in my HTML script to call an external div? I apologise if this is an obvious newbie-style question! But I appreciate any help that anyone out there can give me. Thanks in advance, Kate. Hi I use an include to display an exteral html file in a div. If I strip the html file of all the header formatting, it displays fine. As soon as I add the header info, transitional info etc, it adds a couple of blank line breaks to the top of the text dsiplayed in the external div. here's the link:www.mcbub.com How do I make it so the text starts at the top? thanks in advance! Hello! I'll be using an HTML pulldown menu system for a website, where the menu links are for pages on that website. Easy enough! But....when I add webpages to the website, I'll have to edit the HTML of the menu on each and every webpage to incorporate the new link. Again, easy enough, but time consuming. So I need a system where the pulldown menu looks to an external file for it's links - then, all I have to do is edit one file instead of editing every webpage. Can anyone help? (BTW - I wasn't sure what board to post this in, so if it needs moving to client-side or server-side, that's cool). Hi guys, im trying to setup a simple website for my football team and ive run intio a small problem. I originally had the Navigation code on every page but started to get annoying when i wanted to make changes etc. So by following the FAQ he http://bonrouge.com/~faq#includes I thought id found the answer to my problem but i cant seem to get it to work. The below code is contained in a file called menu.htm <div id="navigation"> <h2>Navigation</h2> <ul> <li><a href="home.htm">Home</a></li> <li><a href="squad.htm">Squad</a></li> <li><a href="fixtures.htm">Fixtures</a></li> <li><a href="matchReport.htm">Match Reports</a></li> <li><a href="news.htm">News</a></li> <li><a href="sponsorship.htm">Sponsorship</a></li> <li><a href="motm.htm">Man of the Match</a></li> <li><a href="forum.htm">Forum</a></li> </div> My code for the first page called "home.htm" is as follows <!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> --> <html> <head> <title>Pavilion FC</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="myCSS.css" rel="stylesheet" type="text/css"> </head> <body> <div id="logo"> <h1></h1> <p> </p> </div> <!--#include file="menu.html"--> </body> </html> Is this code meant to have the comments round it? Should it be in the HTML or CSS file? I also tried converting the files to PHP and usign the line <?php include 'menu.php'; ?> but that didnt seem to work either. Both times the menu just doesnt appear. Im using firefox to view the files offline before uploading, so that id upload it anyway to see if php needed to be enabled or soemthing but still doesnt work. Hi I use an include to display an exteral html file in a div. If I strip the html file of all the header formatting, it displays fine. As soon as I add the header info, transitional info etc, it adds a couple of blank line breaks to the top of the text dsiplayed in the external div. How do I make it so the text starts at the top? Cheers Shaun how can i add onto an html file using php? for example. if i was making a forum chat or something similar, how would i add onto the char using a form, a PHP file, and the main html file that stores the conversation? the thing with this html file is this... Code: <html> <other stuff> <body> PHP file will add text here! <------------------- </body> </html> how do i make the php file add stuff in the middle of the html file? I don't seem to have a robots line/ file anywhere on my webpages. Where am i suppose to put this line of code and what should it contain? If some1 wants to check whether i do have this line or not please have a look at my website on Earnwhileusleep-package.com thnx Hi guys and thanks for reading my post. I am a novice HTML web developer so everything is new to me. Recently I've been really frustrated with IE's script blocking feature. I have been using onmouseover feature that triggers the buttons to change image. I have the script all working and tested in FrontPage, however, any time I go to view the web page, Internet Explorer gives me that little message saying: "To help protect your security, Internet Explorere has restricted this file from showing active content that could access your computer. Click here for options..." I have gone to other web sites which use plenty of onmouseover feature however, and I don't get this message. How are they doing it??? Is there a way to tell IE that the script is harmless or something? Am I using some method that IE says is dangerous? Anyway this is my code <a href="index.html" onmouseover="image0.src='HomeA2.jpg'" onmouseout="image0.src='Home.jpg'"> <img src="Home.jpg" name="image0" border="0" height="42" width="120" alt="Tell A Friend"></a> Anything i can change to prevent IE from blocking it? Please advice me. Greatly Appreciated. Thanks for reading anyway. How do I Link text in a div, h1, h2, p to an external text file or xml file - I don't really know how to ask the question. I think I need an xml file that can be easily edited by a user saved to the server to update an xhtml page text without the user getting bogged down in html. I don't want to use joomla or cms. <Any ideas />? Best wishes, mas |