16 replies [Last post]
HomerSimpson
Offline
Regular
Last seen: 13 years 16 weeks ago
Timezone: GMT-4
Joined: 2008-05-06
Posts: 40
Points: 0

Has anyone seen this particular message that I get in visual studio?

Element 'div' cannot be nested within element 'p'.

Titan793
Offline
Enthusiast
Syracuse, NY
Last seen: 12 years 11 weeks ago
Syracuse, NY
Timezone: GMT-5
Joined: 2009-02-20
Posts: 285
Points: 5

I've never tried nesting a

I've never tried nesting a div inside of a paragraph before.. so no. Is there a reason you need a div nested inside of a paragraph?

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 16 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

You can put a paragraph

You can put a paragraph inside a div or a span inside a paragraph, but you can't put a div in a paragraph.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

HomerSimpson
Offline
Regular
Last seen: 13 years 16 weeks ago
Timezone: GMT-4
Joined: 2008-05-06
Posts: 40
Points: 0

I see. I am working in a

I see. I am working in a stylesheet developed by someone else and since I am using ASP with a contentplaceholder but all I see are a few "

" above in the code.

HomerSimpson
Offline
Regular
Last seen: 13 years 16 weeks ago
Timezone: GMT-4
Joined: 2008-05-06
Posts: 40
Points: 0

I've gotten by that bump and

I've gotten by that bump and see what is causing my problem. I have span rule in my sheet that is affecting my spans in question. If I remove the rule all is fine but it screws up older spans. What to do?

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 16 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

HomerSimpson wrote:What to

HomerSimpson wrote:

What to do?

Post all your code - HTML & CSS.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

HomerSimpson
Offline
Regular
Last seen: 13 years 16 weeks ago
Timezone: GMT-4
Joined: 2008-05-06
Posts: 40
Points: 0

Basically I have this in my

Basically I have this in my css stylesheet which handles my already established spans
span
{
color:blue;
left:15%;
top:45px;
width:40%;
float:left; }

but I now have additional span tags but I don't want them to be influenced by the above CSS.

Titan793
Offline
Enthusiast
Syracuse, NY
Last seen: 12 years 11 weeks ago
Syracuse, NY
Timezone: GMT-5
Joined: 2009-02-20
Posts: 285
Points: 5

I'm going to go out on a

I'm going to go out on a limb here and say that what you just posted is probably not all of your code lol.. post all of your code, and you will get more help.

There may be other things that factor into your issue, that we won't see unless we have all of your code.

HomerSimpson
Offline
Regular
Last seen: 13 years 16 weeks ago
Timezone: GMT-4
Joined: 2008-05-06
Posts: 40
Points: 0

ok, but it's a

ok, but it's a mess.
CSS

.mytable { width: 96%; }
.mydetailsview1{ width: 50%;
	height: 87%; }
 
.myinputbx {background-color: gray;
	border: 0.5pt solid #000000;
border-collapse: collapse;
border-spacing: 0;
font-size: 10pt;
height: 12.5pt;
line-height: 10pt;
margin: 0;
padding: 0 0 -2.5pt 0;
width: 0.75in;
z-index: 1;
clear: left;}
 
.input {background-color: gray;
	border: 0.5pt solid #000000;
border-collapse: collapse;
border-spacing: 0;
font-size: 10pt;
height: 12.5pt;
line-height: 10pt;
margin: 0;
padding: 0 0 -2.5pt 0;
width: 0.75in;
z-index: 1;
clear: left;}
 
 
span
    {
 color:blue;
 left:15%;
 top:45px;
 width:40%;
 float:left; }
 
input { 
 background-color: white; 
}
 
 
 
bodys { background-color: gray; 
	text-align: center;
	min-width: 600px;
}
 
div.pre-head{
  width: 692px;
  float: left;
  padding: 2px;
  height: 28px;
  margin: 15px 4px 0;
  font-size:small;
  background-color : white;
   padding-left:25px;
 
  }
 div.a 
{width: 280px;
  float: left;
  padding: 2px;
  height: 48px;
  margin: 15px 4px 0;
background-color: white;
}
form div.b
{width: 280px;
  float: left;
  padding: 2px;
  height: 48px;
  margin: 15px 4px 0;
 background-color : white;
}
form div.c
{width: 280px;
  float: left;
  padding: 2px;
  height: 48px;
  margin: 15px 4px 0;
  background-color : white;
}
form div.d{
width: 280px;
  float: left;
  padding: 2px;
  height: 48px;
  margin: 15px 4px 0;
  background-color : white;
}
form div.e{
width: 280px;
  float: left;
  padding: 2px;
  height: 48px;
  margin: 15px 4px 0;
  background-color : white;
}
form div.f{
width: 272px;
  float: left;
  padding: 2px;
  height: 58px;
  margin: 15px 4px 0;
  font-size:small;
  background-color : white;
}
form div.g{
width: 280px;
  float: right;
  background-color : white;
  top:10px;
  height:100px;
  width:200px
}
.ddlist1
{float: left;
font-family: verdana;
	}
 
.ddlist2
{background-color : white;
	   font-family: verdana;
	float: left;}
 
.chkb1
{	clear: right;
height:33;
}
 
.spec_lab
{	clear: right;
height:33;
color : blue;
width:133px;
 
}		
.spec_lab2{
float:left;
height:222;
font-size:medium;
color : blue;
width:93px;
}	
 
 
.first-txt
{
 
top:82%;
left:13%;
float:right;
height:222;
font-size:small;
color : red;
width:259px;
border-style: solid;
background-color: orange;
}
 
.second-txt
{float:left;
height:222;
font-size:medium;
color : red;
width:123px;
right:20px;
position:relative;
top:0;
left:1;
}
 
 
.butt1{
 Height:47px; 
  width:100px;
  background: #E0E0E0;
   }
 
 
   .456, span
   {	
position:absolute;
text-align:center;
width:77%;
top:90%;
left:35%;
border-style:none;
background-color:#0077CC;	
visibility:visible;
height:6%;
}
 
 
 .456box
   {
position:absolute;
text-align:center;
width:37%;
top:95%;
left:25%;
border-style: solid;
background-color: purple;	
visibility:visible;
 
}
.eculab, span
{border-style:hidden;
	background:inherit;
color:white;	
visibility:visible;
position:absolute;
width:37%;
top:85%;
left:5%;
}

MARKUP
-----------------------------------------

<head runat="server">
    <title>ECU Search</title>
</head>
 
 
 
        &nbsp;&nbsp;
        <asp:Label ID="Label3" runat="server" Style="z-index: 100; left: 568px; position: absolute;
            top: 552px" Text="Doc nbr" Height="16px" Width="88px"></asp:Label>
        <asp:Label ID="Label1" runat="server" Style="z-index: 101; left: 192px; position: absolute;
            top: 552px" Text="Acct #" Width="79px"></asp:Label>
        <asp:Label ID="Label2" runat="server" Style="z-index: 102; left: 384px; position: absolute;
            top: 552px" Text="Noun" Height="24px" Width="72px"></asp:Label>
    &nbsp;
 
 
        <asp:TextBox ID="TextBox1" runat="server" Style="z-index: 104; left: 160px; position: absolute;
            top: 576px" Width="84px" Height="24px"></asp:TextBox>
        <asp:TextBox ID="TextBox2" runat="server" Style="z-index: 105; left: 352px; position: absolute;
            top: 576px" Height="24px"></asp:TextBox>
        <asp:TextBox ID="TextBox3" runat="server" Style="z-index: 106; left: 560px; position: absolute;
            top: 576px" Width="122px" Height="24px"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Style="z-index: 107;
            left: 432px; position: absolute; top: 664px" Text="Submit" Height="50px" Width="111px" />
 
        <asp:Label ID="Label7" runat="server" Style="z-index: 111; left: 184px; position: absolute;
            top: 624px" Text="Asset code" Width="72px"></asp:Label>
        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
            Style="z-index: 112; left: 176px; position: absolute; top: 648px" DataTextField="assets_cod" DataValueField="assets_cod">
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringSANR %>"
            ProviderName="<%$ ConnectionStrings:ConnectionStringSANR.ProviderName %>" 
            SelectCommand="">
        </asp:SqlDataSource>
 
 
       <span class="456">
        <asp:Label ID="Label4" runat="server"   Text="Primary Nsn" Width="99px"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label5" runat="server"  Text="Label nbr" Height="24px" Width="88px"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label6" runat="server" Text="Part nbr" Height="16px" Width="56px"></asp:Label>
        <br />
        </span>
        <div class="456box">
        <asp:TextBox ID="TextBox4" runat="server" ></asp:TextBox>
        <asp:TextBox ID="TextBox5" runat="server" ></asp:TextBox>
        <asp:TextBox ID="TextBox6" runat="server" ></asp:TextBox>
        </div>
 
 
    <br />
    <br />
    <br />
 
     <div class="ECULAB">
    <asp:Label ID="Label12"  runat="server" Font-Bold="True"  Text="Equipment Queries"></asp:Label>
        </div>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
 
 
</asp:Content>

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 16 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Please post the code from

Please post the code from the browser (view source & copy), not the server-side code, and please use code tags.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

HomerSimpson
Offline
Regular
Last seen: 13 years 16 weeks ago
Timezone: GMT-4
Joined: 2008-05-06
Posts: 40
Points: 0

Here is the "VIEW

Here is the "VIEW SOURCE"
but again, I just want to know how to have some spans follow one rule and other spans to follow another. Any element for that matter.

 
 
 

 

LMCA Logo

Buttons Top

Logistics Logo

Regulations


Contact Us

AFRL Website

LMCA NEWS

Fiscal Year Countdown


Credit Card Purchases

Effective immediately, the micro purchase threshold is $3,000. Therefore, the credit 
More.....

Purchase Querys Divider

ECU Search

  
Doc nbr
Acct #
Noun
 

Asset code

ALL
CANCELED
DEPLOYED
DIRECT_PROC
GFE
HAND_RECEIPT
INV_ADJ
IN_WORK
NON_EAID
ON_HAND
TURN_IN

Primary Nsn      
Label nbr    
Part nbr

Equipment Queries

 

 

Home 
BenchStock
Queries
 
Purchase Queries 
Equipment
Queries
 
Contact Us

Notice and Consent Statement 

Webmaster
 
This Web Site is Compliant with Section 508 Standards.

 

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 50 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

Tyssen asked you to use the

Tyssen asked you to use the code tag. It's right there at the top of the editor, so all you have to do is highlight some text and then click on the code icon at the top of the editor. Guess what it is for...

Now the question is, are you just a bad listener or can you really not figure out how to use that tag? If the former, it's time to learn how to listen, if the latter, then if you can't figure out a straightforward on screen editor how are you going to be able to cope with html and CSS?

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 7 years 21 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

This thread is out of

This thread is out of control.

HomerSimpson
Offline
Regular
Last seen: 13 years 16 weeks ago
Timezone: GMT-4
Joined: 2008-05-06
Posts: 40
Points: 0

sorry, fairly new to this

sorry, fairly new to this forum. What benefit does the code tag do? Am I suppose to put my code ,like this, between the codeTags?

HomerSimpson
Offline
Regular
Last seen: 13 years 16 weeks ago
Timezone: GMT-4
Joined: 2008-05-06
Posts: 40
Points: 0

sorry, fairly new to this

sorry, fairly new to this forum. What benefit does the code tag do? Am I suppose to put my code ,like this, between the codeTags?

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 8 years 4 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

The code tags preserve code

The code tags preserve code formatting and make it easier to read the code, and yes you have used them correctly in you last example.

Now to stop the thread running off the rails: To answer the remaining question if you need to enusre that an element such as a span doesn't receive styles when you don't want it to you have two choices

1/ use descendent styling to apply styles only to the span that you intend e.g:

#sidebar p span {color:red}
 
<div id="sidebar">
  <p><span>spanned text</span></p>
</div>
 
<div id="content">
 <p><span>this text is not red but browser default</span></p>
</div>

2/ use class tokens to add the styles specifically to the span element that you want styled, ensuring that it is only those that receive the special styling

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

HomerSimpson
Offline
Regular
Last seen: 13 years 16 weeks ago
Timezone: GMT-4
Joined: 2008-05-06
Posts: 40
Points: 0

I've been only using

I've been only using .classes in my stylesheets thus far, no ID's until I saw your example.