Skip to main content
Hosun
Inspiring
6月 10, 2019 8:58 午後 UTC
解決済み

pseudo elements [How to tweak CSS properties to layout page elements?]

Hi,

I drew two lines (black and red) as pseudo elements.

1.

How would I move the red line to the center?

For the black line, I didn't do anything for it.

2.

With the red line, there is a difference to the photo and to the text.

I gave "margin-top" to .footnote and .fn1, but it didn't work.

How would I shift the text down?

Hosuns Portfolio 3

Hosun Kang

このトピックへの返信は締め切られました。
osgood_解決!
Legend
6月 11, 2019 1:28 午後 UTC

It's much cleaner to wrap your thumbnail images in a 'section' element:

<section class="thumbnails">

<div><img src="images/thumbnail1-love.png" alt="pic1"></div>

<div><img src="images/thumbnail2-office.jpg" alt="pic2"></div>

<div><img src="images/thumbnail3-dan.jpg" alt="pic3"></div>

<div><img src="images/thumbnail4-beer.jpg" alt="pic4"></div>

<div><img src="images/thumbnail5-report.png" alt="pic5"></div>

<div><img src="images/thumbnail6-indesign.png" alt="pic6"></div>

</section>

Then use the css below to position them, plus its easy to apply the top and bottom border to the 'section' rather than using 'before' and 'after'

.thumbnails {

display: flex;

flex-wrap: wrap;

justify-content: space-between;

border-top: 1px solid #000;

border-bottom: 1px solid red;

padding: 10px 0 0 0;

margin: 0 1% 15px 1%;

}

.thumbnails img {

max-width: 100%;

height: auto;

display: block;

}

.thumbnails div {

width: 32%;

margin: 0 0 15px 0;

}

/*Tablet View*/

@media (max-width: 1024px) {

.thumbnails div {

width: 48%;

}

}

/*Mobile View*/

@media (max-width: 500px) {

.thumbnails div {

width: 100%;

}

}

返信数 6

Nancy OShea
Community Expert
Community Expert
6月 11, 2019 11:17 午後 UTC

As a Creative Cloud member, you have a free Adobe Portfolio website available to you.  It's hosted  on Adobe's servers so there are no hosting or maintenance fees to worry about.  It's responsive and no coding skills required.  I mention this  because what you're struggling with now in Dreamweaver is  nearly identical to what Adobe Portfolio provides out of the box.

It's so simple to use, you can showcase your work online in minutes rather than days, weeks or months.

Adobe Portfolio | Build your own personalized website

  1. Just log-in at the URL above with with your Adobe ID and password.
  2. Pick a Layout Theme.
  3. Add some pages, content, images, videos,  etc...
  4. Hit the Publish / Update Live Site button and you are done.
  5. With one click, you can share your Portfolio projects with your Behance page, another online venue for creatives. Behance

翻訳
Nancy O'Shea— Product User & Community Expert
Nancy OShea
Community Expert
Community Expert
6月 10, 2019 10:17 午後 UTC

Another option is the horizontal rule or <hr> tag.   A line used to visually divide elements.

How To Style the HR Element with CSS

翻訳
Nancy O'Shea— Product User & Community Expert
Nancy OShea
Community Expert
Community Expert
6月 10, 2019 10:08 午後 UTC

I odn't understand what you're trying to do.  Have you never heard of the CSS border property?

CSS Borders

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Untitled Document</title>

<style>

.top-border {

border-top: 2px solid red;

}

.bottom-border {

border-bottom: 2px dotted #555;

}

</style>

</head>

<body>

<div class="top-border">

<p>This is a division with a solid red top border.</p>

</div>

<div class="bottom-border">

<p>This is a division with a dotted bottom border.</p>

</div>

</body>

</html>

翻訳
Nancy O'Shea— Product User & Community Expert
osgood_解決!
Legend
6月 11, 2019 1:28 午後 UTC

It's much cleaner to wrap your thumbnail images in a 'section' element:

<section class="thumbnails">

<div><img src="images/thumbnail1-love.png" alt="pic1"></div>

<div><img src="images/thumbnail2-office.jpg" alt="pic2"></div>

<div><img src="images/thumbnail3-dan.jpg" alt="pic3"></div>

<div><img src="images/thumbnail4-beer.jpg" alt="pic4"></div>

<div><img src="images/thumbnail5-report.png" alt="pic5"></div>

<div><img src="images/thumbnail6-indesign.png" alt="pic6"></div>

</section>

Then use the css below to position them, plus its easy to apply the top and bottom border to the 'section' rather than using 'before' and 'after'

.thumbnails {

display: flex;

flex-wrap: wrap;

justify-content: space-between;

border-top: 1px solid #000;

border-bottom: 1px solid red;

padding: 10px 0 0 0;

margin: 0 1% 15px 1%;

}

.thumbnails img {

max-width: 100%;

height: auto;

display: block;

}

.thumbnails div {

width: 32%;

margin: 0 0 15px 0;

}

/*Tablet View*/

@media (max-width: 1024px) {

.thumbnails div {

width: 48%;

}

}

/*Mobile View*/

@media (max-width: 500px) {

.thumbnails div {

width: 100%;

}

}

翻訳
Hosun
Hosun作成者
Inspiring
6月 11, 2019 11:56 午後 UTC

Hi,

Thank you very much for very useful tips every time.

I have one more question.

In your instruction below, why 1%? not px for measurement unit.

Hosuns Portfolio 3

Hosun Kang

翻訳