ASP.NET: How to insert blank lines in aspx page? - asp.net

I tried to do this to insert a few blank lines in my web page (to separate my text from an image displayed through a script) but it didn't work:
<asp:ContentPlaceHolder ID="ContentText" runat="server">
</asp:ContentPlaceHolder>
<p></p><p></p><p></p><p></p><p></p>
<script type="text/javascript"><!--
...
If you have time to explain to me why the series of p's and closing p's didn't work, that'll be great. Otherwise, please just tell me how to insert some space there. Thanks.

Try this
<div style="height: 100px"></div>

You need <br /> which is a line break.
<p> are for paragraphs and will separate any text between the opening and closing tag with any other elements, as they are all empty there is no effect.
Investigate <div> and <span> as there are countless ways to separate elements rather than just a blank line.

Wouln't it be better to use CSS to achieve what you want? If you only need a vertical spacing between your text and your image. I would add a top margin to the image you are inserting throught javascript.
For example:
<asp:ContentPlaceHolder ID="ContentText" runat="server">
Your text is here
</asp:ContentPlaceHolder>
<img src="javascript-inserted-image.jpg" width="100" height="100" style="margin-top: 50px;" />
In real life, I would be using a CSS class that I would assign to the image instead of applying the margin to the style attribute of the image.
Edited:
Your image would also need to be displayed as a block element (CSS style display: block;) if your the content of your place holder is not a block element like a p, div, blockquote, etc...

Related

How to hide tags in a specific position in CSS?

I have a custom built CMS and content looks fine in the WYSIWYG editor, but on the web site front end there are extra br tags that shouldn't be there, I'm wondering if I can hide them using CSS (there is a master.css file)
Here's an example of the problem - note the br tag at the end of each line
<div class="column threequarter">
<h3>I need to hide the break tag at the end of this line and the following line</em></strong> </p><br />
<p> </p><br />
<h4>I need to hide the break tag at the end of this line</h4><br />
<p>I also need to hide the break tag at the end of this line.</p><br />
Trouble is, I don't want to hide ALL br tags throughout the site but if I could just hide them within the then that would probably suffice.
As the HTML documentation in the link https://www.w3schools.com/tags/tag_br.asp says, The <br/> tag also supports the Global Attributes in HTML. You just set a class for the required <br/>tag and then set display:none; for those particular elements. Here is an example,
HTML:
<br class="mystyle" />
CSS:
.mystyle{
display:none;
}

anchor with changing iframe content

I tried to comment on this question for clarification to what I might need but without enough rep I can't so here we go...
I want change the content of an iframe while targeting an anchor tag to scroll to a certain point lower on the page.
I tried to implement the js on the other page but while it scrolled ok, the iframe content did not change.
Try this example:
<html>
<body>
The frame:
<iframe id="theFrame" src="about:blank" width="90%" height="600"></iframe>
<br />
The link: change frame and scroll to bottom
<br />
<div style="height:600px;background:#8cc">padding...</div>
Bottom of page.
<div id="bottomOfPage"><div><!--this is the marker-->
</body>
</html>

CSS inline-block divs not displayed right

can anyone please help me? I have this example of list of links with description. http://jsfiddle.net/FcN57/3/ and I need the decription to start at same line as the first link, but it's allways starting one line below. I thought that inline-block divs should be displayed side by side
If you need to keep the <br /> for some reason (although i don't recommend it like the others here), then the following might work for you:
http://jsfiddle.net/FcN57/12/
I added floats and a clear:both to put them on the same line.
You have page breaks in your code. A <br> will break the flow and put any elements after it on a new line, regardless of display type.
Remove them and it works fine.
http://jsfiddle.net/Kyle_Sevenoaks/FcN57/6/
To display description on same line, remove <br /> tag. Also you can use span instead of div. span will display text on same line.
http://jsfiddle.net/FcN57/10/
They are being displayed inline unfortunatly you've forced a line break here
<div class="EsdVyberDocOdkaz">
<a href="9CYjKkqzUU71" >link</a>
<br> //this is your issue
(
<a href="9CYjKkqzUU71" >link</a>
)
</div>
You can either remove that line break and have everything on one line or move your bracketed link after your description like so:
<div class="EsdVyberDoc">
<div class="EsdVyberDocOdkaz">
<a href="9CYjKkqzUU71" >link</a>
</div>
<div class="EsdDocTitul">
description description description
</div>
<br />
(
<a href="9CYjKkqzUU71" >link</a>
)
</div>

How to display text in front and use a image in back ground?

I want to create a div which has background image and want to display some text on it. I have tried my self but i dont know why its not work for me. My code is as below:
<div style="background-image: image/test.jpg">
<asp:label id="test" runat="server" text="hello" />
</div>
Please let me know where i am wrong.
See https://developer.mozilla.org/en/CSS/background-image. The address should be wrapped in url():
style="background-image: url(image/test.jpg)"
Also of interest might be the background property which allows more control over placement, repetition and fill color.
The style is slightly wrong, it should be:
style="background-image: url('image/test.jpg');"

Image along with text in HTML, asp.net

I am using asp.net and C#.
I have a image and three line. Which I want to place like this
Like the one you can see in this below URL .
http://www.campaignmonitor.com/gallery/
Image is on the left side and parallel to image we can write text.
I know that the same can be acheived by HTML table / ASP.NET table like this
<table>
<tr>
<td>
<img src="#"/>
</td>
<td>
first line <br />
second line <br/>
third line <br />
</td>
</tr>
</table>
but my problem is that I can't use table, so please let me know how can i acheive the above task without using tables.
Might be <span> or <div> tag can do the trick. but I am really dumb in html. and I can't ever search the exact answer to my problem on google..
Using CSS, you can float the image to the left, which will cause the text to appear to the image's right.
For example, take the following:
<html>
<head><title>Example</title></head>
<body>
<div style="float:left"> <!-- I've floated the div containing the image to the left -->
<img src="http://www.google.com/images/srpr/nav_logo13.png">
</div>
This is text that is to the right of the image.
</body>
</html>

Resources