HTML - Code Colouring
Hi Guys,
I'm pretty new to coding, and up until now I've been using TextMate as my code editor. One of the things I like about TextMate is that it gives me very precise control over the colour of the code. Fro example, I can specify a colour just for hex numbers. Now that's all well and good, but I recently started using Dreamweaver and although there is some control over the colour of individual code elements, it seems very basic (e.g. in CSS it's limited to eight very broad areas - via Prefs > Code Coloring). Am I missing something, surely there must be a way to get more precise control over code colour? si Similar TutorialsSorry for the dodgy title lol. I didn't know what to call it. My web designer has create my quote form with insert boxes for Name, Phone number etc. which are yellow (so people know to fill them in) however there are a few other boxes which are currently white. I would also like to make these boxes yellow. How would I go about this? Thanks! I'm making an HTML-based text editor for Windows PCs. The editor needs to have some special functions, and one of them is the automatic colouring of certain keywords. Here's the situation. (Apologies if little of the following is relevant, but I can't be sure.) The editor is part of a program. When the user wants to write something, the editor is created (an instance of the Windows WebBrowser) and custom HTML is loaded into it. So it's displaying a spontaneously-created HTML page. This page includes a section marked contenteditable=true, and that's where the user types. When the user is finished writing, they press a button, the current HTML in the browser is read and the text is extracted from it and saved, and the browser is destroyed. All that works fine. However, I'm having trouble building in some special functions. Namely keyword colouring. The host program allows the user to set a number of keywords, and a colour for each one. The idea is that when the user is typing in the editor, keywords will be detected and coloured. This colouring process needs to happen in realtime. As an amateur, I naively thought it would suffice to just read the HTML intermittently, scan for the keywords and add tags to each one, like this: Code: <SPAN style=text-colour:#FF00FF>thekeyword</SPAN> But there are several problems with this method. Every time the HTML is revised and reloaded into the browser, the "page" is scrolled back to the top. (As an aside, if anyone knows a method for getting and setting the caret position in an HTML page, I'd be grateful to know it too!) The second problem is that if the user types in the middle of a keyword, the new text inherits the colour. So obviously the tags method isn't going to be sophisticated enough. What I need is a smart way to detect and recolour keywords on the fly. Some form of syntax highlighting, I suppose. Does anybody know any tricks for doing this? JavaScript perhaps? Below is an example of what I want to achieve. As you can see, the caret is in the middle of a keyword. If the user pressed the spacebar, the editor would immediately look like the second image. What do you think? Is it possible? Thanks for reading, Seymour. Hello, I am a student and working on a simple first project. All I'm doing right now is writing my code in text edit, saving it as "test.html", and dragging and dropping the file onto Safari/Firefox to view my code. Everything works when I'm at my college's computer lab, but when I'm on my own mac notebook, the files load in the browser as my code. I've tried a variety of samples and checked my preferences, but I can't figure out what I'm doing wrong. Sample code I'm using - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Simple Link Example 2</TITLE> </HEAD> <BODY> <H1 ALIGN="CENTER">Creating Relative Reference Links</H> <HR> <P>Open <A HREF="practice1.html">Practice 1</A>.</P> <P> Open <A HREF="practice2.html">Practice 2</A>.</P> <P>Open <A HREF="practice3.html" TARGET="_blank"> Practice 3</A> in a new window.</P> </BODY> </HTML> Please help! I'm trying to wrap up an assignment and have been banging my head against the wall all night. Thanks! cordelia I was curious to find out, where can i find a cool looking shoutbox code where i can put on my message forum? Looking for some neat, and cozy with some advance options. Meaning, i would like to change the colors to match with my forum and stuff. Thanks. Hello! I have a blog on blogger and i want to make a c++ tutorial.. But every time i type "<iostream>" on post, when i see it, it is only "iostream". How can i make a code like the "[code]" from BBcode to cancel the compiling from HTML? Thanx! I have a website where I want to make a drop down menu that will bring you to different pages. It is a very basic, sort of old-fashioned website that relies entirely on html. What I'm trying to do is make a drop-down menu that will be used as navigation for a section of a website and I want to have it in each internally linked page in that section, but I'm going to be adding more pages to it over time so I want to be able to put the drop-down menu code in a separate text file and then substitute it into the pages that I make that the options in the menu link to and then just edit the code in the text file when I add another page so that I don't have to go back and edit the code every single individual page whenever I add a new one among them. Basically all I'm asking is how I can put html code in a text file and then substitute that code into an html page by referring to the file. Thanks in advance for any help. I need a Dev code, for the scroll bar that goes in your page, and one that is trnasparent would be REALLY great, or one with the ability for a background image? Thanks What im trying to do is add a search box for travel like this one: http://osc4.template-help.com/wt_31362/index.html How is this done? please anyone Hi, I just want a code that when you hit a link it opens a new window, with specific height and width and at the same time works equal with Internet Explorer and Firefox. Is a kind of "full screen pop up". I hope you can help me with that. I got some code of a tutorial for an image slider, and I used NotePad ++ to edit it with my images and links. But I don't know whats wrong?!? It won't load. I put it in Wordpress and upload the images and it doesn't work! I have attached the code file. Thanks is anyone can help! Hi, what's this code for: ?tag= What is it for and what does it do if it's attached to something like this: http://www.ABC.com/images/spacer.gif?tag=ABC And if I rearrange the domain and file path, does this still work for whatever it's for: ?tag=ABC Thanks in advance for your help! Hello i would really apreciate if some1 could help me with this kind of code : I have some thumbnails images and i want to play embed videos for each image, and the video to apears in a specific location .... If some1 could help thank you in advance I really need help with www.classic-corvettes-ky.com/monday.html to send an email containing data entered when a user clicks "Submit" or refresh the page when the user clicks "Reset". Hi, hope this is the right place to post.. can someone tell me what is this code? and convert it for me? and what it does? Code: %3ChTmL%3E%3CtItLe%3E...%3C/tItLe%3E%3CBoDy%20bGcOlOr%3D%22%236 E0Ab4%22%3E%3CCeNtEr%3E%3C%21--%20PrAeSeNt%20qUiS%20FeLiS.%20aL iQuAm%20aC%20AnTe.%20MoRbI%20RiSuS%20ToRtOr%2C%20PoRtA%20NoN%2C %20uLtRiCeS%20Ac%2C%20CoNvAlLiS%20Id%2C%20NiSi.%20VeStIbUlUm%20 bLaNdIt%20eLiT%20Et%20oRcI.%20dOnEc%20aC%20PuRuS%20SiT%20AmEt%2 0nIsI%20LaCiNiA%20CoMmOdO.%20cUrAbItUr%20hEnDrErIt%20jUsTo%20uT %20EsT.%20nUlLa%20mOlEsTiE%20RhOnCuS%20LaCuS.%20vIvAmUs%20cOnSe QuAt%20lAcUs%20uT%20NuLlA.%20fUsCe%20mOlEsTiE%20VeNeNaTiS%20NiB h.%20PrOiN%20VeLiT.--%3E%3CImG%20BoRdEr%3D%220%22%20sRc%3D%22/_ img/_img-b1.jpg%22%20WiDtH%3D%22480%22%20HeIgHt%3D%22200%22%3E% 3C%21--%20LoReM%20IpSuM%20DoLoR%20SiT%20AmEt%2C%20CoNsEcTeTuEr% 20aDiPiScInG%20ElIt.%20DuIs%20mAlEsUaDa.%20PrAeSeNt%20iMpErDiEt %20fElIs%20vItAe%20aUgUe.%20NuLlA%20QuIs%20lEcTuS%20Ac%20sApIeN %20SuScIpIt%20pLaCeRaT.%20pHaSeLlUs%20vIvErRa%20pUrUs%20eT%20Ma SsA.%20nUlLa%20pReTiUm.%20AeNeAn%20eU%20AuGuE.%20cUrAbItUr%20mE tUs%20nIsI%2C%20cOmMoDo%20uT%2C%20cOnVaLlIs%20sIt%20aMeT%2C%20f EuGiAt%20nEc%2C%20SaPiEn.%20PeLlEnTeSqUe%20oRnArE%20OrNaRe%20pU rUs.%20PrAeSeNt%20bIbEnDuM%2C%20eNiM%20Ut%20cOnGuE%20NoNuMmY%2C %20lEo%20tElLuS%20RhOnCuS%20NuNc%2C%20In%20mAlEsUaDa%20dIaM%20E lIt%20sEd%20nIbH.%20mAuRiS%20TiNcIdUnT%20ArCu%20nOn%20pEdE.%20n Am%20cOnGuE%20ElEiFeNd%20mEtUs.%20DoNeC%20EgEt%20iPsUm%20aT%20D uI%20TiNcIdUnT%20SeMpEr.%20DoNeC%20FeRmEnTuM%20FeLiS%20Et%20pEd E.%20pElLeNtEsQuE%20Ut%20nUlLa%20sIt%20aMeT%20ErOs%20cUrSuS%20C oNsEqUaT.%20pElLeNtEsQuE%20UlTrIcIeS%20OrCi%20sIt%20aMeT%20Mi%2 0rHoNcUs%20oRnArE.%20fUsCe%20mAuRiS%20OrCi%2C%20LuCtUs%20aT%2C% 20vEhIcUlA%20Et%2C%20DiCtUm%20nEc%2C%20SaPiEn.%20MaUrIs%20cOmMo Do%2C%20JuStO%20A%20OrNaRe%20lAcInIa%2C%20PuRuS%20LiBeRo%20cOnV aLlIs%20eRoS%2C%20eT%20SaGiTtIs%20lEo%20aUgUe%20sEd%20vElIt.--% 3E%3C/cEnTeR%3E%3C/BoDy%3E%3C/hTmL%3E thanks I know very basic html.. hyperlinks adding a few odds and ends but overall pretty basic html. Now what Im trying to do is a few things.. 1) Make an autosorting alphebetical list. (So if i add a new title I dont have to manually find the spot where it goes, it will sort if for me) 2) Make 2 colums wide. Here is the blog: http://kl-axxo-n.blogspot.com/ Can someone point me in the right direction for code to place an MP3 on my website? I would like it to be available to listened to online and also to download. Thanks. I want to use the code on this website: http://geekfile.googlepages.com/flvplay.... I have a video that i converted to flv on my computer...what do I do? Please help...I dont know where I put my information in this code not sure if im posting this in the right place.... but is there a code... javascript perhaps... to prevent the browser from printing? The last paragraph on my code shows up as bold letters. Can someone please tell me why? here are my codes HTML Code: <html> <head> <title>Top ten NBA player of all time</title> <style type="text/css"> h1 {font-size: 30; font-family: arial;} h2 {font-size: 12; font-family: arial;} h3 {font-size: 22; font-family: arial;} h4 {font-size: 16; font-family: arial;} p {font-size: 14; font-family: arial;} </style> </head> <body> <h1>This is a list of the top ten NBA players of all time</h1> <h2> Written by Luke Ritchie</h2> <br/> <br/> <br/> <h3>The NBA</h3> <p>The NBA has had millions of players in it long, rich history. <br/> The NBA started in 1946 as the BAA (Basketball Association of American),<br/> then merged with the NBL (National Basketball League) and became<br/> known as the NBA in 1950. Today, I will be listing ten players, who i <br/> think are the greatest ever.</p> <hr /> <h3>10. Oscar Robertson</h3> <img src="http://sportige.com/wp-content/uploads/2010/02/Oscar-Robertson.jpg" width="400" height="400" alt="Oscar Robertson" title="Oscar Robertson" /> <p>Oscar Robertson. His nickname was "The Big O", and he Played for the Cincinnati Royals and the Milwaukee Bucks. <br/> He was the only player ever to average a triple-doule over the course of a season. <br/> He played piont guard, and was named to 12 All-Star teams. Oscar was the the key component on the Bucks in the 1970-1971, <br/> and lead them to win there only NBA title. Robertson was inducted into the <br/> Naismith Memorial Basketball Hall of Fame in 1980, and was voted one of the 50 Greatest <br/> Players in NBA History in 1996. Though All of his accomplishments came with plenty strugle, <br/> His playing career, especially during high school and college, was filled with <br/ racism and hatred toward him, and his fellow black players. Both numbers he <br/> wore, 14 on the Sacramento Kings, and 1 on the Milwaukee Bucks, were retired. <br/> He will live forever in the basketball Hall Of Fame. </p><br/> <hr /> <h3>9. Shaquille O'Neal</h3> <img src="http://www.clap.name/images/Shaq4.jpg" width="275" height="400" alt="shaquille o'neal" title="shaquille o'neal" /> <p>In his prime, Shaq may have been the best big man in the history of the league. <br/> There wasnt a person in the league that could stop him in his prime, which was in the early 2000s. <br/> He won 3 championships with the lakers and Kobe Bryant, despite Kobe and Shaqille butting heads. <br/> Then went on to win another championship in Miami with Dwayne Wade. Shaqs defense may have been <br/> equal to his offence, he was an all-around great player, and will undoubtedly end up in the <br/> Hall Of Fame in his first year of eligibility.</p><br/> <hr /> <h3>8. Bill Russell<h3> <img src="http://www.achievement.org/achievers/rus0/photos/rus0-013a.gif" width="350" height="400" alt="Bill Russell" title="Bill Russell" /> <p>Bill Russell is the greatest winner ever. 11 championships in 13 seasons, its a record that will <br/> likely never be beaten. Most people say championships are the most imporntant thing when judging greatness, <br/> so it could be argued that Russell should be number one, but the era he played in wasnt nearly as <br/> competitive as todays game. Bill is also one of the greatest defenders of all time, blocks <br/> weren't recorded in his time, but he probably would have been at the top of the record books <br/> if they did. He was inducted into the Hall Of fame in 1975.</p><br/> <hr /> <h3>7. Tim Duncan</h3> <p>T</p> </body> </html> need help on 2 areas 1st have created a form what i would like it to do is as soon as the submit button is hit it sends directly to my mail account rather than open a mail program first would, also be kinda neat to have a thank you message displayed after submit the second is i have option menu and would like an action to happen depending on what is selected ie a calendar will be available so clients can self check availability the option displays month of the year when you select a month the diary for that month will open i dont know code but am doing my best reading and looking stuff up i have tried all day but cant find what i want to do any help would be great |