html

Will I trigger a change event if I use Javascript to set a <option> as selected?

I've observed that, in Google Chrome, setting an <option> as selected via Javascript does not trigger the respective <select> tag's change event. Can I count on this behavior holding true in all other modern browsers? ...

Loading scripts dynamically

I'm loading a few YUI scripts dynamically in my code in response to an Ajax request. The DOM and the page is fully loaded when the request is made - it's a response for an user event. I add the tag to head, as children. But I stumbled in a few problems: I add two YUI scripts hosted at the Yahoo! CDN and an inlined script of my own res...

create anchors in a page with the content of <h2></h2> in PHP

Well I have a html text string in a variable: $html = "<h1>title</h1><h2>subtitle 1</h2> <h2>subtitle 2</h2>"; so I want to create anchors in each subtitle that has with the same name and then print the html code to browser and also get the subtitles as an array. I think is using regex.. please help. ...

CSS3-based Carousel in Any Direction Regardless of Order

I'm been trying to build a simple Carousel effect for a set of photos. Its is easy to do using the Effects library with PrototypeJS but I'm having problems understanding how to implement this with CSS3. I've built out some solutions but they have only worked if there order of the photos in the HTML is also the order in which you plan to...

Restrict SVG to div boundaries

Hi, I'm trying to show multiple polygons as SVG image on a div using Raphael. Although, I've set up the size for the div Raphael gets as an argument to create the paper object, the size of the div element is not respected and the image is drawn outside of the div boundaries (which I somehow understand, as the polygon coordinates go beyo...

FireFox 16px gap between DIVs problem

My website renders correctly in Chrome but it shows a 16px gap, between divs, in FF. What could be wrong here? Link to Application: http://simateriaisportal.appspot.com (Conta -> Dashboard). The code i posted before was working correctly, the problem comes when content (dashboard) is filled dynamicaly ...

min-width, max-width, width. Nothing work in IE8 on body tag

Hello, This is my web page which doesn't work in IE8 but works in FF 3.6.4 and Opera 9.63 :- <html> <head> <style type="text/css"> body{ max-width:10002px; min-width:3072px; width:10002px; margin:0px auto; background:#293231; ...

passing meta data in body part

hi, i use php for coding. is there a way to pass meta in the body part. so that it is recognized by serach engines. i know meta tags needs to be passed in head. but since i am generating pages dynamically . only body part get changed in every page. ...

Align text to the center of a div

I have a div thats about 200px x 40px. Sometimes this block will contain a single line of text and other times it will contain two lines. In the case that it contains 2 lines of text, I have adjusted the line height so that it looks balanced inside of the div. However, in the case that there is a single line of text, the text lines up w...

Rendering (streaming) HTML into Pane

My program generates results concurrently. I want to append each result, as soon as it enters the swing-thread, to a pane which shall render the result's html-fragment like: <ol class="result-type-a"><li class="foo-result"><html-output-of-result .../></li></ol> Is the JTextPane the right component? Are there problems with my "streami...

Setting max AND min height property in CSS (or via jQuery)

Hi there, I have a simple but annoying problem. I need to set min-height AND max-height of a div element. For example min-height could be 100px and max-height 200px. I load my page with div height 200px. If i squeeze my browser window, this div resizes and when it hits height=100px it stops resizing. Of course min-height and max-heigh...

javascript: how to display html page from string

hi. i generate some html content dynamically like var content = "<head><title>testtitle</title></head><body>testbody</body>"; then i get myself a new tab with about:blank, and now i want to display my generated html in this tab. if the tab's contentDocument is newDoc, i thought i just do newDoc.documentElement.innerHTML = content; ...

What is the opposite of CLICK event?

I had a list <li> where the content inside li should get bold when it is clicked. For that i used the following code HTML <ul class="tabs"> <li><a href="#tab1" style="padding-left:5px;">All Sectors</a></li> <li><a href="#tab2">Information Technology</a></li> <li><a href="#tab3">Manufacturing</a></li> <...

Concrete class names vs classes hierarchy

What is the best-practice for those examples? 1) <style type="text/css"> .block .title {color:red} .anotherBlock .title {color:blue} </style> ... <div class="block"> <h3 class="title">SomeTitle</h3> </div> <div class="anotherBlock"> <h3 class="title">anotherTitle</h3> </div> ... 2) <style type="text/css"> .blockTitle {colo...

Do I need to html-encode title attributes (tooltips)?

In my markup I am using HTML title attributes which I set by the Tooltip property of various ASP.NET controls like an asp:Label. The content of those titles come from a database and I use data binding syntax, for instance: <asp:Label ID="PersonLabel" runat="server" Text='<%# HttpUtility.HtmlEncode(Eval("PersonShortName")) %>' T...

sticky CSS footer broken

My footer is designed to stay at the bottom of the page even if the div above it only has a small amount of content. It worked until recently, and I seem to have broken it somehow. Can you take a look? Thanks in advance. CSS: body { margin: 0; padding: 0; height: 100%; font: 100% Helvetica, sans-serif, Arial, sans-ser...

cannot access child element - jquery

Hello. I have a HTML like <div class="a"> <div class="b"> something </div> <div class="c"> <div class="subC"> i want to access </div> </div> </div> and jquery like $('.a').hover(function(){ $(this).children('.subC').fadeOut(); }) I Want to access the class "subC" but above i...

When matching html or xml tags, should one worry about casing?

If you are parsing html or xml (with python), and looking for certain tags, it can hurt performance to lower or uppercase an entire document so that your comparisons are accurate. What percentage (estimated) of xml and html docs use any upper case characters in their tags? ...

Extra padding under an <img> tag?

Hi, I'm getting some sort of padding below an img tag in my webpage. The html looks like: <li> <div>Title</div> <img src='...' width='60px' height='60px' /> </li> Yeah so there is about 5 pixels of padding beneath the image (I can tell because the bg color of the parent li item is different). I tried assigning a class to the img ...

Select option in drop down menu HTML

Hi, I want to beable to select an option in a select by the value that has been gotten from the session is this possible? So eg in my list: Book Conference Journal And for example book was in the session so it selects the book in the drop down menu. Thanks in Advance Dean ...