Repeater containing a speech bubble

The image above shows the rendered CSS after changing the background color of .speech_bubble_content to red. However, the speech bubble is not displaying correctly.

I am using the code below to fetch data from a database and bind it to a repeater. I have also applied CSS to create a speech bubble around the content. Strangely, when I place a label outside the div, the data is displayed properly while placing it inside results in only the creation date being shown, with the story omitted. I suspect this issue is caused by CSS - can anyone help me resolve this? Thank you for your assistance.

<asp:Repeater ID="Repeater1" runat="server">

   <ItemTemplate>

    <div class="speech_bubble">
    <b class="sb1"></b><b class="sb2"></b><b class="sb3"></b><b class="sb4"></b><b class="sb5"></b><b class="sb6"></b><b class="sb7"></b>
    <div class="speech_bubble_content">
    <p>

    <asp:Label ID="story" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Story") %>'></asp:Label>


    </p>

    </div>
    <b class="sb7"></b><b class="sb6"></b><b class="sb5"></b><b class="sb4"></b><b class="sb3"></b><b class="sb2"></b><b class="sb1"></b>
    <em></em><span></span>
    </div>
    <asp:Label ID="user" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CompanyRole") %>'></asp:Label>&nbsp;<asp:Label ID="date" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CreationDate") %>'></asp:Label>

    </ItemTemplate>
   </asp:Repeater>

Here is the CSS used:

.speech_bubble{
background: transparent;
margin:10px 0;
}
.speech_bubble_content{
display:block; 
background:#fff; 
border:3px solid #ddd; 
border-width:0 3px;
}
.speech_bubble p{
padding:0.5em 0; 
color:#000;
margin:0 15px; 
}
.sb1, .sb2, .sb3, .sb4, .sb5, .sb6, .sb7{
display:block; 
overflow:hidden; 
font-size:0;
}
.sb1, .sb2, .sb3, .sb4, .sb5, .sb6{
height:1px;
}
.sb4, .sb5, .sb6, .sb7{
background:#fff; 
border-left:1px solid #ddd; 
border-right:1px solid #ddd;
}
.sb1 {margin:0 8px; background:#ddd;}
.sb2 {margin:0 6px; background:#ddd;}
.sb3 {margin:0 4px; background:#ddd;}
.sb4 {margin:0 3px; background:#fff; border-width:0 5px;}
.sb5 {margin:0 2px; background:#fff; border-width:0 4px;}
.sb6 {margin:0 2px; background:#fff; border-width:0 3px;} 
.sb7 {margin:0 1px; background:#fff; border-width:0 3px; height:2px;} 

.speech_bubble em{
display:block; 
width:0; 
height:0; 
overflow:hidden; 
border-top:12px solid #ddd; 
border-left:12px dotted transparent; 
border-right:12px dotted transparent; 
margin-left:50px;
}
.speech_bubble span{
display:block; 
width:0; 
height:0; 
overflow:hidden; 
border-top:10px solid #fff; 
border-left:10px dotted transparent; 
border-right:10px dotted transparent; 
margin-left:52px; 
margin-top:-15px;
}

Answer №1

Following Rene's suggestion would be a good idea. Take a look at the source, copy the HTML and CSS, then save it to http://jsbin.com/ and provide us with the link so we can examine the actual HTML that .NET is generating.

You could also simply use

<%#DataBinder.Eval(Container.DataItem, "Story") %>

instead of using an asp:label, which may introduce unnecessary HTML tags.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can we add styles to text entered into a form input field in a targeted way?

Is there a way to apply styling to the second word entered into a form input text field after the user hits "enter" and the data is output? In this scenario, the text always follows the format of 3 numbers, followed by a space, and then a name. For examp ...

I encounter issues when editing a GridView where both the data keys and new values are null

I am working with an ASPX code for a grid view that looks like this: ASPX: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AutoGenerateEditButton="True" BackColor="White" BorderColor="#CC9966" ...

Is it feasible to retrieve the return URL using JavaScript/jQuery?

I have encountered an issue on my website where users are still logged in even after timing out. This allows them to make ajax requests, which triggers the redirect feature of my asp.net mvc authorization tag. Normally, unauthorized users would be redirec ...

What is the best way to implement material theme colors into my Angular2 CSS?

Suppose I want to utilize the mat-primary color as a background for a div using a CSS/SASS class, how should I reference it? My initial thought was: @import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; .my-class{ background-colo ...

Displaying identical information in a bootstrap dropdown menu

I am working on implementing a navigation bar with Bootstrap dropdown functionality. Each button in the navbar has the same content displayed in the dropdown menu, such as the "Exercises" button showing assignments and the "Assignments" button also displ ...

Menu Items at the Center

I am currently working on a Wordpress website and struggling to center the menu items that are currently aligned to the left. I have created a child theme from the existing theme's code, but still can't figure out how to achieve this simple task. ...

Access to Begin Operation Rejected

While attempting to execute my test through Appium's server, I encountered the following error: Permission to start activity denied The goal was to run the Chrome app without requiring the APK file since it is already installed on my device. appPac ...

Creating a FusionCharts time series with a sleek transparent background

Currently, I am attempting to achieve a transparent background for a time-series chart created with FusionCharts. Despite trying the standard attributes that usually work on other chart types and even hardcoding a background color, none of these seem to af ...

Issue with iPad Pro displaying Bootstrap 4 Navbar toggle icon

Having trouble with my Bootstrap 4.1.1 navbar on iPadPro. It's not displaying the correct data from the div and it's not collapsing properly. However, it works fine on small devices. Any suggestions on how to fix this issue? Here's the code ...

Transforming a numeric value into a 4-byte array using JavaScript

Attempting to write a node server has brought me to the challenge of sending a 32-bit integer to a C# client as the header. The bit shift operators are a bit confusing for me and I am uncertain about how to proceed. It seems that my C# client expects thes ...

The visual effects of CSS 3D transformations vary between PCs and mobile devices, creating a distinct contrast

I'm experiencing a rendering issue with a 3D transform. On Chrome (PC/Mac), it appears as shown below: https://i.sstatic.net/pDbwN.png However, on mobile devices using Safari or Chrome, the display is different: https://i.sstatic.net/1mQHl.jpg When ...

Return to the initial stage of a multistep process in its simplest form following a setTimeout delay

I recently customized the stepsForm.js by Copdrops and made some modifications. Although everything works well, I'm struggling to navigate back to the initial step (first question) after submitting the form due to my limited knowledge of JavaScript. ...

Error encountered when using the SaveAsFile method with two parameters

Having an issue with Selenium in C#, I ran into a problem while attempting to utilize the SaveAsFile method that requires two parameters. Specifically, I was trying to pass ScreenshotImageFormat.png as the second parameter and kept encountering a compile-t ...

Tailored Bootstrap form styles for different screen sizes

Can someone please help me understand how to create a custom Bootstrap class that applies to a specific breakpoint? I've tried using w-md-50, w-sm-100, w-lg-75 for a form, but it doesn't seem to be working for the targeted breakpoint. Are there a ...

CSS: Adjusting font color for targeted disabled field elements

After researching various solutions, I came across a method to change the font color of all disabled fields by using the following code snippet: input[disabled=disabled] { /* your style */ color: #fff !important; } However, I have multiple disabled fie ...

Tips for evenly distributing list elements in HTML without using whitespace

After reading the article on flexbox techniques without actually using flexbox, I attempted to implement "space-between" in my code: ul { margin: 0; padding: 0; text-align: justify; } ul:after { content: ""; display:inline-block; width:100%; ...

Unable to save configuration file with PerUserRoaming parameter in a .NET project

Currently, I am in the process of developing a WPF project and I am looking to save user settings. I have been using the ConfigurationManagerClass for this purpose and have referred to the following links (http://msdn.microsoft.com/en-us/library/system.con ...

Navigation Map and User Permissions

I have been attempting to develop a sitemap menu that is role-based, but I am encountering an issue. When I assign all roles to the root menu and then assign individual roles to specific menu items, all menu items still display. <?xml version="1.0" enc ...

Create a moving background gradient with styled-components

Currently, I am working on setting the background of the <Paper /> component using Material-UI version 1.0.0-beta.25 to display a gradient of colors. The colors are dynamically added by clicking the Add button and selecting one from the color picker. ...

Unable to apply inset box-shadow to image

I've added a box-shadow to my image. box-shadow: 0 0 10px RED inset However, the shadow is not showing up on the image. When I use Firebug to change the image path, I can see that the shadow is behind the image. How can I apply the shadow directly ...