Programming Solution

.NET in Sql Server

Creating Role in SQL Server Database using C#

Forms Authentication Workaround for Accessing SSAS Cube Data

.NET Windows Application

ListView, ListViewItem and ListViewSubItem in .Net Windows Form

SelectionChangeCommitted and SelectedIndexChanged events: System.NullReferenceException while closing Windows Form

C#

JSON to Object Conversion in C#

JSON to c-sharp Object Conversion and c-sharp Object to JSON Conversion (Part II)

Parallel Programming not supported with Entity Framework

Cannot Implicitly Convert Type IQueryable

Lambda Restriction Functions

Design Pattern

When to use Abstract Factory and Factory Method Pattern

Excel

Regular Expression in Excel Find and Replace Window

Enter a Newline in a Value of a Cell in Excel

HTML

HTML Div tag inside HTML P (paragraph) tag does not work correctly

IE6-IE7 Radio Button JQuery Problem: Selection does not work

Javascript

Javascript variable declaration with Var and without Var: Global variable Vs Local Variable

URL Parsing Using JavaScript: Get Domain Name, Port Number and Virtual Directory Path

JavaScript Object Array Sorting: Using Custom Comparison Function

Implement JavaScript HashTable

IE6-IE7 Radio Button JQuery Problem: Selection does not work

Casting JQuery Object to JavaScript Object and JavaScript Object to JQuery Object

JQuery Input Tag Dom Creation Problem

JQuery Accordion Item Height Adjust Based on Content

JSON to c-sharp Object Conversion and c-sharp Object to JSON Conversion (Part II)

Inheritance in JavaScript

JavaScript Object Expected Error-Casting a Variable to JQuery Object and Assigning in Same Variable in IE6

JQuery Sortable Event Firing Sequence

Variable Length Argument in JavaScript Function Call

JavaScript MVC – Step by Step Approach

Dynamically Accessing JavaScript Object Property and Object Member Method Using Variable

JavaScript Array Extension

JavaScript Add Array to Array

jquery

JQuery Accordion Item Height Adjust Based on Content

JQuery Sortable Event Firing Sequence

JavaScript MVC – Step by Step Approach

MDX Query

MDX query for Subtree Members and Leaf Members

Finding Last n members of a Particular month of a particular Year from a Time Dimension using MDX

Hierarchical Ordering of Members of a Hierarchy

VBA Functions in MDX

miscellaneous

Iframe src error: Content was blocked because it was not signed by a valid security certificate

mssql xquery

Getting XML node names and values in tabular format

SQL Server Xquery FLWOR Examples

TSQL XQUERY LET

XQuery Function Requires Singleton or Empty Sequence

XQuery Concat Function

SharePoint

Get Detail Error Message for “An unexpected error has occurred”

Where to get VseWss 1.3 Service

Ajax call in SharePoint does not reach Web Service Method

Sql Server 2008

SQL Partition By clause

Comma Separated string of all the rows of a column

EXECUTE sp_executesql

Use of SQL Case Statement in SQL Update Statement

Using sql case statement in order by clause

XML Data into a Relational Table Using OPENXML

Getting XML node names and values in tabular format

Date formatting in SQL Server

SQL Server Xquery FLWOR Examples

Inserting Rows into SQLServer from CSV file

Nested case when statement

Comma Separated List (CSV) of rows of a column using FOR XML PATH

Integer sequence generator, Date sequence generator

SQL Server Pivot: Converting Rows to Columns with Dynamic Query

Removing Leading and Trailing White Space Characters in TSQL

SQL Server Array: Implementing TSQL Array Using XML and XQuery

Finding All the Unicode Character Values Used in a String using TSQL

Finding Invisible Characters in TSQL String and Remove Invisible Characters with Space

TSQL String Functions

Comparison between TSQL Inner Join and Left/Right Join

User Does Not Have Permission to Create a New Object in SQL Server

Finding and Deleting the Duplicate Rows Using SQL Partition By

ISALPHA and ISINT in SQL Server

Update Statement Performance Improvement for Large Table

SQL Order By

Data Generation Plan to Generate Dummy Test Data for SQL Server Tables

Integer sequence generator, Date sequence generator

SQL Server Management Studio (SSMS)

SQL Server Table Design: Saving changes is not permitted

User Does Not Have Permission to Create a New Object in SQL Server

SSAS 2008

Finding Last n members of a Particular month of a particular Year from a Time Dimension using MDX

MDX query for Subtree Members and Leaf Members

Period Dimension (Time Dimension) Creation with Year, Month, Day Hierarchy

Creating Role in SQL Server Database using C#

Hierarchical Ordering of Members of a Hierarchy

Creating Local Cube or Offline Cube from SSAS 2008

Retrieve SSAS Cube Data in Tabular Format from Stored Procedure using Linked Server

How to setup the server where the cube will be deployed

Forms Authentication Workaround for Accessing SSAS Cube Data

SSAS 2008 with Excel 2007 Pivot Table

Creating Connection to an Analysis Service Database or Cube from Excel 2007

Introducing the Design Tab of Pivot Table Tools in Excel 2007

SSRS

Changing Default MDX Query Generated by SSRS Query Designer to Avoid set with more than 4,294,967,296 tuples error

Changing the default plus sign to minus while the report is still expanded: InitialToggleState

InvalidOperationException: Client found response content type of ‘’, but expected ‘text/xml’. The request failed with an empty response.

TSQL

Padding TSQL String Using a Character for a Particular Length

Delete Rows of a Table Matching Multiple Columns of Another Table

ISALPHA and ISINT in SQL Server

Update Statement Performance Improvement for Large Table

SQL Order By

Removing the last character from a TSQL string

Use of Recursive CTE (Common Table Expression) in a Hierarchical Table to Find Descendant Elements

Easiest way to find and delete duplicate rows from a table using CTE in SQL Server

Integer Sequence Generator Using CTE (Common Table Expression)

IsPalindrome in T-SQL

All Character Occurrence in TSQL

nth Occurrence of a character in a string

TSQL CLR

TSQL CLR: Custom Aggregate Function (Concat)

VBA

Checking a Date whether it is weekend or monthend in VBA

Create Folder if the Folder does not Exist in VBA

Loop through all files in a folder using VBA

Column Letter from Index and Column Index from Column Letter in VBA

VBA Power Function

VBA For Loop/For Each Loop: Different Way of using VBA For Loop

October 6, 2010

HTML Div tag inside HTML P (paragraph) tag does not work correctly

Filed under: HTML — admin @ 3:08 am

Consider the following html. We have a p tag. Inside this paragraph, we have some child elements. In this case, we have span, select, div and input elements. But while the browser will render this, it will not be able to render it correctly. Because html p tag does not support a div tag inside it. It can contain span, select, input or others, but cannot contain div.

<p id=”PFS_regimen”>

<span style=”width: 250px;“>Select Product/Form/Strength:</span>

<select name=”ddl_pfs” id=”ddl_pfs” style=”width: 300px”>

<option value=”">select from list</option>

</select>

<div style=”height: 2px; width: 300px;“>&nbsp;</div>

<span style=”width: 250px;“>Enter Regimen Name:</span>

<input type=”text” name=”txt_regimen_name” id=”txt_regimen_name” value=”untitled” />

<div style=”height: 2px; width: 300px;“>&nbsp;</div>

</p>

The above screenshot is taken from Developer Tools of internet explorer. The DOM object is created which is shown in the screenshot. This shows that the div is at the same level with p, which in fact should be a child of p similar to other child tags. So this is in fact a wrong HTML hierarchy. While creating DOM object, browser considered that div as the end of p tag and made a sibling.


If we remove the divs inside the p tag, everything will be fine. So the elements inside p tag are appearing as child elements.

<p id=”PFS_regimen”>

<span style=”width: 250px;“>Select Product/Form/Strength:</span>

<select name=”ddl_pfs” id=”ddl_pfs” style=”width: 300px”>

<option value=”">select from list</option>

</select>

<span style=”width: 250px;“>Enter Regimen Name:</span>

<input type=”text” name=”txt_regimen_name” id=”txt_regimen_name” value=”untitled” />

</p>


Even if we can replace the div with span and it will work.

<p id=”PFS_regimen”>

<span style=”width: 250px;“>Select Product/Form/Strength:</span>

<select name=”ddl_pfs” id=”ddl_pfs” style=”width: 300px”>

<option value=”">select from list</option>

</select>

<span style=”height: 2px; width: 300px;“>&nbsp;</span>

<span style=”width: 250px;“>Enter Regimen Name:</span>

<input type=”text” name=”txt_regimen_name” id=”txt_regimen_name” value=”untitled” />

<span style=”height: 2px; width: 300px;“>&nbsp;</span>

</p>



Some Other Posts

    Tags:

    No Comments »

    No comments yet.

    RSS feed for comments on this post. TrackBack URL

    Leave a comment

    Powered by WordPress