[英]how can i add tabs, new line inside textarea content?
I am trying to develop a blogging website where I am writing a code for creating a blog page, here I am taking the blog content using a textarea and after writing the blog content user has to publish using the publish button.我正在尝试开发一个博客网站,我正在编写用于创建博客页面的代码,这里我使用文本区域获取博客内容,并且在编写博客内容后,用户必须使用发布按钮发布。
so I have to write a code for this textarea where I need to give tabs in paragraphs and next lines and scrollbar is there any way to achieve this?所以我必须为这个文本区域编写一个代码,我需要在段落和下一行和滚动条中给出标签,有没有办法实现这一点? so that when I will be published this, there will be a proper paragraph in a blog?
这样当我发表这篇文章时,博客中就会有一个合适的段落?
<section class="body-section">
<div class="blog-wrapper">
<span class="title">
<input type="text" class="form-control form-control-lg" name="title" placeholder="Title for your blog" id="txtTitle">
</span>
<span class="txtareaBody">
<textarea name="txt" class="form-control" placeholder="start writing your blog.." id="comment" rows="20" scrollable></textarea>
</span>
<span>
<input type="file" placeholder="upload thumbnail image" formnovalidate name="imgUpload" id="ImgUpload" class="form-control">
</span>
</div>
</section>
To provide tab in paragraphs use the tab property and define the tab size.This would provide the required spacing in the text area.Here I have provided the code for your reference.要在段落中提供制表符,请使用制表符属性并定义制表符大小。这将在文本区域中提供所需的间距。这里我提供了代码供您参考。 You can also refer the link provided to know more on inserting tabs and spaces in HTML: https://www.geeksforgeeks.org/how-to-insert-spaces-tabs-in-text-using-html-css/
您还可以参考提供的链接以了解有关在 HTML 中插入制表符和空格的更多信息: https://www.geeksforgeeks.org/how-to-insert-spaces-tabs-in-text-using-html-css/
<style>.tab { tab-size: 2; } </style> <section class="body-section"> <div class="blog-wrapper"> <span class="title"> <input type="text" class="form-control form-control-lg" name="title" placeholder="Title for your blog" id="txtTitle"> </span> <span class="tab"> <textarea name="txt" class="form-control" placeholder="start writing your blog.." id="comment" rows="20" scrollable></textarea> </span> <span> <input type="file" placeholder="upload thumbnail image" formnovalidate name="imgUpload" id="ImgUpload" class="form-control"> </span> </div> </section>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.