Выровняйте абзац по ширине страницы в HTML, CSS - PullRequest
1 голос
/ 09 июля 2020

У меня есть этикетка, и я добавил несколько абзацев для нее. Поэтому я попытался сделать то же самое в своем скрипте, но здесь происходит неправильное выравнивание абзаца. Я хочу, чтобы абзац был выровнен по 3/4 страницы. Так что я могу сохранить пространство ниже.

<html>

<head>


  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!--Stylesheets-->
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
  <link href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet" />
  <link href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet">

  <!--JS-->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

</head>

<body>
  <h2 class="grey_text text-center">Details</h2>
  <div class="container col-md-offset-1">
    <div class="container col-md-offset-1">
      <div id="form">
        <form>
          <fieldset>
            <div class="col-md-4 form-display">
              <label class="col-md-8" for="comments:">Added comments:</label>
              <div>
                <p>Respected Sir/Madam, My name is nnnnn. I have completed my Bachelor's degree from this college in the field of Engineering. I love problem-solving and reducing the complexity of issues, this pushed me towards Software technology. I have interned as a test engineer at a firm called vvvvvvvv and learned fundamental about testing. I always want to learn about new technologies and want to apply them in real life, which is why I feel I am suitable for this internship. The project's link which I have worked the respective Github repository link/Google drive link can be found in my resume. I am attaching my resume, certificate, and Linkedin profile for your reference. Looking forward to hearing from you soon. Thanks and regards, nnnnnnn LinkedIn profile: https://www.linkedin.com/in/nnnnnn/</p>
              </div>
            </div>

          </fieldset>
        </form>
      </div>
    </div>
  </div>
</body>

</html>

Если я удалю библиотеки Bootstrap и jQuery из скрипта, абзац будет выглядеть хорошо. Но мне нужны библиотеки Bootstrap и ajax, так как я использую стиль jQuery, Bootstrap в оставшейся программе и в другом поле. Я попробовал

text-align: justify;text-justify: inter-word;

, включив его в тег <p>. Включив перенос слов, он также не сработал.

Мне нужно, чтобы абзац отображался по ширине, чтобы он выглядел красиво.

1 Ответ

1 голос
/ 09 июля 2020

Ниже я думаю, что вы пытаетесь достичь, а именно показать абзац на 1/4 страницы. Если это не то, что вы хотите сделать, вы можете прокомментировать ниже, и я с радостью отредактирую, чтобы помочь вам.

<!DOCTYPE html>
<html>

<head>


  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!--Stylesheets-->
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
  <link href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet" />
  <link href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet">

  <!--JS-->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

</head>

<body>
  <h2 class="grey_text text-center">Details</h2>
  <div class="container-fluid">
    <div class="row">
      <div id="form">
        <form>
          <fieldset>
              <label class="col-md-8" for="comments:">Added comments:</label>
              <div class="col-8" >
                <p>
                  Respected Sir/Madam, My name is nnnnn. I have completed my Bachelor's degree from this college in the field of Engineering. I love problem-solving and reducing the complexity of issues, this pushed me towards Software technology. I have
                  interned as a test engineer at a firm called vvvvvvvv and learned fundamental about testing. I always want to learn about new technologies and want to apply them in real life, which is why I feel I am suitable for this internship. The
                  project's link which I have worked the respective Github repository link/Google drive link can be found in my resume. I am attaching my resume, certificate, and Linkedin profile for your reference. Looking forward to hearing from you
                  soon. Thanks and regards, nnnnnnn LinkedIn profile: https://www.linkedin.com/in/nnnnnn/</p>
              </div>

          </fieldset>
        </form>
      </div>
    </div>
  </div>
</body>

</html>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...