עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Transparent Box בCSS

Featured Replies

פורסם

http://www.w3schools.com/css/css_image_transparency.asp

עשיתי את אותו הקוד, אבל עם תמונה שונה.

CSS:

div.background  {
width:500px;
height:250px;
background:url(download.jpg) repeat;
border:2px solid black;

}
div.transbox
{
width:400px;
height:180px;
margin:30px 50px;
background-color:#ffffff;
border:1px solid black;
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
}
div.transbox p
{
margin:30px 40px;
font-weight:bold;
color:#000000;
}

HTML:

<div class="background"><div class="transbox">
<p>BLA
</p>
</div>
</div>

תוצאה:

fznngtxhammj.jpg

1. ניסיתי בעזרת text-align:center להעביר את התיבה לאמצע, גם בdiv.background, גם בdiv.transbox וגם בdiv.transbox p וזה לא זז לאמצע.

2. התמונה יוצאת חתוכה ולא טוב, זה לא קשור לwidth / height בדקתי. איך אפשר לשנות את זה?

תודה

פורסם

אם הבנתי נכון את השאלה שלך, אתה רוצה:

* לשים תמונת רקע חוזרת מהפינה השמאלית ביותר

* לשים תיבת טקסט שקופה מעט באמצע העמוד


<!DOCTYPE html>
<html>
<head>
<style>
.background
{
background: url(klematis.jpg) 0 0 repeat;
}
.transbox
{
width: 400px;
height: 180px;
margin: 0 auto;
background-color: #ffffff;
border: 2px solid black;
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
}
.transbox p
{
margin: 0;
padding: 20px 30px;
font-weight: bold;
color: #000000;
}
</style>
</head>
<body>
<div class="background">
<div class="transbox">
<p>This is some text that is placed in the transparent box.</p>
</div>
</div>
</body>
</html>

פורסם
  • מחבר
אם הבנתי נכון את השאלה שלך, אתה רוצה:

* לשים תמונת רקע חוזרת מהפינה השמאלית ביותר

* לשים תיבת טקסט שקופה מעט באמצע העמוד


<!DOCTYPE html>
<html>
<head>
<style>
.background
{
background: url(klematis.jpg) 0 0 repeat;
}
.transbox
{
width: 400px;
height: 180px;
margin: 0 auto;
background-color: #ffffff;
border: 2px solid black;
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
}
.transbox p
{
margin: 0;
padding: 20px 30px;
font-weight: bold;
color: #000000;
}
</style>
</head>
<body>
<div class="background">
<div class="transbox">
<p>This is some text that is placed in the transparent box.</p>
</div>
</div>
</body>
</html>

תודה רבה, אך זה לא הבעיה. הייתי צריך להכניס margin:auto;

עשית את הrepeat כמו שצריך, זה באמת עזר, תודה.

אם תוכל, להגיב לי גם כאן: http://hwzone.co.il/community/threads/533670-%D7%A2%D7%99%D7%A6%D7%95%D7%91-%D7%AA%D7%A4%D7%A8%D7%99%D7%98-HTML-CSS?p=4792085#post4792085

זה יעזור מאוד. תודה. (קיבלת "תודה").

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.