اضافة اكواد برمجية داخل المقال في بلوجر

تجربة الأكواد البرمجية في المقالات بشكل عصري وحديث وسهل التعامل معه


كود CSS

.related h2 {
  font-size: 20px;
  font-family: 'Cairo', sans-serif !important;
  font-weight: bold;
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid $(main.color);
}

#related-posts {
  margin: 20px auto;
  padding: 10px;
  border-radius: 10px;
  box-sizing: border-box;
  text-align: center;
  font-family: 'Cairo', sans-serif !important;
}

/* 2. بطاقة المقال */
.related-thumb {
  display: inline-block;
  width: 220px;
  margin: 8px;
  padding: 10px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
  transition: 0.3s;
  box-sizing: border-box;
  vertical-align: top;
  border: 1px solid #ececec;
}

.related-thumb:hover {
  transform: translateY(-4px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
}

/* 3. ضبط الصورة ومنع التشويه */
.related-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover; /* ضبط القص الذكي بدون تمطيط */
  object-position: center;
  border-radius: 8px;
  transition: 0.3s;
}

.related-thumb img:hover {
  opacity: 0.85;
}

/* 4. عنوان المقال الفرعي */
.related-title-thumb {
  margin-top: 8px;
  font-size: 14px;
  line-height: 22px;
  height: 44px;
  color: #222;
  overflow: hidden;
  font-family: 'Cairo', sans-serif !important; /* تم تغيير الخط هنا لـ Cairo */
  font-weight: 600;
}

.related-title-thumb:hover {
  color: $(main.color);
}

/* 5. التجاوب مع الشاشات الصغيرة والموبايل */
@media(max-width: 991px) {
  .related-thumb {
    width: 45%;
    margin: 6px;
  }
}

@media(max-width: 600px) {
  .related-thumb {
    width: 100%;
    margin: 8px 0;
  }

  .related-thumb img {
    height: 160px;
    object-fit: cover; /* الحفاظ على عدم تشويه الصورة في الموبايل */
  }
}

كود JavaScript

كود HTML


  
    
      
        أندرويد
      
      
  
  
    

إضافة تعليق