0

index.vue

<template>
  <div>
    <Tasks />
  </div>
</template>

Tasks.vue

  <div class="tasks-container">
    <div class="tasks">
      <div class="tasks-item">
        <div class="tasks-task">
          <span class="label"></span>
          <h1>Lorem ipsum dolor sit amet conse pisicing elit</h1>
        </div>
        <button>abc</button>
      </div>
      <br />
      <div class="tasks-item">
        <div class="tasks-task">
          <span class="label"></span>
          <h1>Lorem ipsum dolor sit amet</h1>
        </div>
        <button>xyz</button>
      </div>
    </div>
  </div>
</template>

<style scoped>
.tasks-container {
  max-width: 1000px;
  margin: auto;
}
.tasks {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tasks-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8f8f8;
  padding: 25px 30px;
}
.tasks-task {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 65%;
}
.tasks-task .label {
  width: 70px;
  height: 70px;
  background: #947777;
  border-radius: 50%;
}
.tasks-task h1 {
  color: rgba(6, 6, 6, 0.75);
  font-size: 36px;
  width: 80%;
}
.tasks-item button {
  background-color: #8482c4;
  color: #ffffff;
  font-size: 20px;
  padding: 4px 35px;
  border-radius: 20px;
}
</style>

chrome

firefox

The layout looks perfect in Google chrome & Microsoft edge but not on Mozilla firefox as shown in the images. The two divs get attached in firefox. What is the reason behind happening this? How can I solve this issue? Please help me to solve this. Thank you in advance.

  • I get my answer from this link https://stackoverflow.com/questions/10500551/br-not-working-in-firefox –  Jul 15 '21 at 12:06

1 Answers1

0

You have to first use a CSS reset so that it looks same on all browsers, otherwise every browsers will apply its own default style.

/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}
<div class="tasks-container">
    <div class="tasks">
      <div class="tasks-item">
        <div class="tasks-task">
          <span class="label"></span>
          <h1>Lorem ipsum dolor sit amet conse pisicing elit</h1>
        </div>
        <button>abc</button>
      </div>
      <br />
      <div class="tasks-item">
        <div class="tasks-task">
          <span class="label"></span>
          <h1>Lorem ipsum dolor sit amet</h1>
        </div>
        <button>xyz</button>
      </div>
    </div>
  </div>
</template>

<style scoped>
.tasks-container {
  max-width: 1000px;
  margin: auto;
}
.tasks {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tasks-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8f8f8;
  padding: 25px 30px;
}
.tasks-task {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 65%;
}
.tasks-task .label {
  width: 70px;
  height: 70px;
  background: #947777;
  border-radius: 50%;
}
.tasks-task h1 {
  color: rgba(6, 6, 6, 0.75);
  font-size: 36px;
  width: 80%;
}
.tasks-item button {
  background-color: #8482c4;
  color: #ffffff;
  font-size: 20px;
  padding: 4px 35px;
  border-radius: 20px;
}
</style>

Apply this reset and then apply the styles and it should look same irrespective of the browser.