63 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
		
		
			
		
	
	
			63 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
|   | --- | ||
|  | id: bad87fee1348bd9aedf08816 | ||
|  | title: Link to External Pages with Anchor Elements | ||
|  | challengeType: 0 | ||
|  | videoUrl: '' | ||
|  | localeTitle: وصلة إلى الصفحات الخارجية مع عناصر مرساة | ||
|  | --- | ||
|  | 
 | ||
|  | ## Description
 | ||
|  | <section id="description"> يمكنك استخدام عناصر <code>anchor</code> للربط بمحتوى خارج صفحة الويب الخاصة بك. تحتاج عناصر <code>anchor</code> إلى عنوان ويب مقصود يسمى سمة <code>href</code> . هم أيضا بحاجة إلى مرساة النص. في ما يلي مثال: <code><a href="https://freecodecamp.org">this links to freecodecamp.org</a></code> ثم يعرض المتصفح النص <strong>"روابط إلى freecodecamp.org"</strong> كحلقة يمكنك النقر عليها. وسيأخذك هذا الرابط إلى عنوان الويب <strong>https://www.freecodecamp.org</strong> . </section> | ||
|  | 
 | ||
|  | ## Instructions
 | ||
|  | <section id="instructions"> إنشاء <code>a</code> العنصر الذي يربط <code>http://freecatphotoapp.com</code> ولديه "صور القط"، كما لها <code>anchor text</code> . </section> | ||
|  | 
 | ||
|  | ## Tests
 | ||
|  | <section id='tests'> | ||
|  | 
 | ||
|  | ```yml | ||
|  | tests: | ||
|  |   - text: الخاص بك <code>a</code> يجب أن يكون العنصر في <code>anchor text</code> من "صور القط". | ||
|  |     testString: 'assert((/cat photos/gi).test($("a").text()), "Your <code>a</code> element should have the <code>anchor text</code> of "cat photos".");' | ||
|  |   - text: 'تحتاج إلى <code>a</code> العنصر الذي يربط <code>http://freecatphotoapp .com</code>' | ||
|  |     testString: 'assert(/http:\/\/(www\.)?freecatphotoapp\.com/gi.test($("a").attr("href")), "You need an <code>a</code> element that links to <code>http://freecatphotoapp<wbr>.com</code>");' | ||
|  |   - text: تأكد من <code>a</code> عنصر يحتوي على علامة إغلاق. | ||
|  |     testString: 'assert(code.match(/<\/a>/g) && code.match(/<\/a>/g).length === code.match(/<a/g).length, "Make sure your <code>a</code> element has a closing tag.");' | ||
|  | 
 | ||
|  | ``` | ||
|  | 
 | ||
|  | </section> | ||
|  | 
 | ||
|  | ## Challenge Seed
 | ||
|  | <section id='challengeSeed'> | ||
|  | 
 | ||
|  | <div id='html-seed'> | ||
|  | 
 | ||
|  | ```html | ||
|  | <h2>CatPhotoApp</h2> | ||
|  | <main> | ||
|  | 
 | ||
|  | 
 | ||
|  | 
 | ||
|  |   <img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."> | ||
|  | 
 | ||
|  |   <p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p> | ||
|  |   <p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p> | ||
|  | </main> | ||
|  | 
 | ||
|  | ``` | ||
|  | 
 | ||
|  | </div> | ||
|  | 
 | ||
|  | 
 | ||
|  | 
 | ||
|  | </section> | ||
|  | 
 | ||
|  | ## Solution
 | ||
|  | <section id='solution'> | ||
|  | 
 | ||
|  | ```js | ||
|  | // solution required | ||
|  | ``` | ||
|  | </section> |